94 TEXT(
"ROS Explorer - reading user settings"),
141 FmtString
msg(
TEXT(
"%s\n"), txt);
152 static const LPCTSTR s_executable_extensions[] = {
171 for(
p=s_executable_extensions; *
p;
p++)
185 return found->second;
198 valuelen =
sizeof(display_name);
220 if (!
type._displayname.empty())
224 if (
type._neverShowExt && !dont_hide_ext) {
227 if (
entry->_display_name !=
entry->_data.cFileName)
339 BitmapSelection sel(canvas,
hbmp);
356 BitmapSelection sel(canvas,
hbmp);
420 PathCacheMap::iterator found =
_pathCache.find(mapkey);
423 return _icons[found->second];
431 return _icons[found->second];
440 return _icons[found->second];
500 return _icons[found->second];
520 HICON hIconLarge = 0;
548 PidlCacheMap::iterator found =
_pidlcache.find(mapkey);
551 return _icons[found->second];
559 return _icons[found->second];
568 return _icons[found->second];
586 const Icon& icon =
add(sfi.iIcon);
654 if (found !=
_icons.end()) {
655 Icon& icon = found->second;
723 cmd._cmdShow = cmdShow;
727 cmd.ParseCmdLine(lpCmdLine);
753 else if (*
p==
',' && !
quote)
836 if (!
_path.empty()) {
853 lpCmdLine =
TEXT(
"explorer.exe");
873 OwnerDrawParent<Dialog>
887 _hfont =
CreateFont(20, 0, 0, 0,
FW_BOLD,
TRUE, 0, 0, 0, 0, 0, 0, 0,
TEXT(
"Sans Serif"));
923 PaintCanvas canvas(_hwnd);
966 CommonControlInit usingCmnCtrl;
987 Window::MessageLoop();
1012 BOOL startup_desktop;
1017 while(*lpCmdLine ==
'-') {
1018 while(*lpCmdLine && !
_istspace((
unsigned)*lpCmdLine))
1019 ext_options += *lpCmdLine++;
1069 startup_desktop =
TRUE;
1075 startup_desktop = !any_desktop_running;
1079 bool autostart = !any_desktop_running;
1091 startup_desktop =
TRUE;
1094 startup_desktop =
FALSE;
1097 if (startup_desktop && !
_tcsstr(ext_options,
TEXT(
"-explorer")))
1117 LOG(
TEXT(
"starting explorer debug log\n"));
1122 if (startup_desktop) {
1134 if (!any_desktop_running) {
1137 (*g_SHDOCVW_ShellDDEInit)(
TRUE);
1141 bool use_gdb_stub =
false;
1144 use_gdb_stub =
true;
1147 LOG(
TEXT(
"debugger breakpoint"));
1154 LOG(
TEXT(
"waiting for debugger connection...\n"));
1166 CommonControlInit usingCmnCtrl;
1170 if (startup_desktop) {
1183 "/e open cabinet window in explorer mode\r\n"
1184 "/root open cabinet window in rooted mode\r\n"
1185 "/mdi open cabinet window in MDI mode\r\n"
1186 "/sdi open cabinet window in SDI mode\r\n"
1188 "-? display command line options\r\n"
1190 "-desktop start in desktop mode regardless of an already running shell\r\n"
1191 "-nodesktop disable desktop mode\r\n"
1192 "-explorer display cabinet window regardless of enabled desktop mode\r\n"
1194 "-install replace previous shell application with ROS Explorer\r\n"
1196 "-noautostart disable autostarts\r\n"
1197 "-autostart enable autostarts regardless of debug build\r\n"
1199 "-console open debug console\r\n"
1201 "-debug activate GDB remote debugging stub\r\n"
1202 "-break activate debugger breakpoint\r\n",
1203 "ROS Explorer - command line options",
MB_OK);
1214 if (startup_desktop) {
1217 pSSOThread->Start();
1222 const char*
argv[] = {
"",
"s"};
1243 if (!any_desktop_running) {
1246 (*g_SHDOCVW_ShellDDEInit)(
FALSE);
pair< _T1, _T2 > _STLP_CALL make_pair(_T1 __x, _T2 __y)
static void startup(void)
VOID WaitCursor(BOOL bBegin)
static VOID CenterWindow(HWND hWnd)
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
BOOL WINAPI AllocConsole(VOID)
#define RegCloseKey(hKey)
_Rep_type::iterator iterator
static const WCHAR quote[]
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
BOOL WINAPI ImageList_DrawEx(HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, INT dx, INT dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
#define GetProcAddress(x, y)
static const WCHAR *const ext[]
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
BOOL WINAPI SetProcessShutdownParameters(IN DWORD dwLevel, IN DWORD dwFlags)
#define SHGFI_ADDOVERLAYS
#define ATTRIBUTE_EXECUTABLE
#define CLASSNAME_CHILDWND
#define CLASSNAME_WINEFILETREE
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLboolean GLboolean GLboolean b
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
_Check_return_ _CRTIMP FILE *__cdecl _fdopen(_In_ int _FileHandle, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl setvbuf(_Inout_ FILE *_File, _Inout_updates_opt_z_(_Size) char *_Buf, _In_ int _Mode, _In_ size_t _Size)
_CRTIMP void __cdecl _wsplitpath(_In_z_ const wchar_t *_FullPath, _Pre_maybenull_ _Post_z_ wchar_t *_Drive, _Pre_maybenull_ _Post_z_ wchar_t *_Dir, _Pre_maybenull_ _Post_z_ wchar_t *_Filename, _Pre_maybenull_ _Post_z_ wchar_t *_Ext)
void __cdecl __debugbreak(void)
@ OWM_ROOTED
window in explore mode
_In_ BOOL _In_ HANDLE hProcess
BOOL IsAnyDesktopRunning()
void SetWindowIcon(HWND hwnd, UINT nid)
set big and small icons out of the resources for a window
int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
ExplorerGlobals g_Globals
static bool SetShellReadyEvent(LPCTSTR evtName)
DynamicLoadLibFct< void(__stdcall *)(BOOL)> g_SHDOCVW_ShellDDEInit(TEXT("SHDOCVW"), 118)
HBITMAP create_small_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
int initialize_gdb_stub()
HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
void explorer_about(HWND hwndParent)
static void InitInstance(HINSTANCE hInstance)
int ImageList_AddAlphaIcon(HIMAGELIST himl, HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
add icon with alpha channel to imagelist using the specified background color
#define ICON_SIZE_FROM_ICF(flags)
#define STARTMENUROOT_ICON_SIZE
struct ExplorerGlobals g_Globals
HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
#define IDD_ABOUT_EXPLORER
#define IDS_EXPLORER_VERSION_STR
BOOL RecursiveCreateDirectory(LPCTSTR path_in)
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
String get_windows_version_str()
#define Window_SetIcon(hwnd, type, hicon)
#define WINDOW_CREATOR(WND_CLASS)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
#define PROCESS_ALL_ACCESS
#define FILE_ATTRIBUTE_DIRECTORY
_Out_opt_ int _Out_opt_ int * cy
struct _IMAGELIST * HIMAGELIST
_Check_return_ _CRTIMP int __cdecl _dup2(_In_ int _FileHandleSrc, _In_ int _FileHandleDst)
_CRTIMP int __cdecl _open_osfhandle(_In_ intptr_t _OSFileHandle, _In_ int _Flags)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define SHGFI_SYSICONINDEX
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
#define PathRemoveBackslash
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Exception with context information.
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0)
base of all file and directory entries
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
CtlColorParent< OwnerDrawParent< Dialog > > super
ExplorerAboutDlg(HWND hwnd)
Explorer command line parser.
bool EvaluateOption(LPCTSTR option)
bool ParseCmdLine(LPCTSTR lpCmdLine)
structure containing global variables of Explorer
void init(HINSTANCE hInstance)
bool read(LPCTSTR path)
read XBEL bookmark file
bool import_IE_favorites(HWND hwnd)
import Internet Explorer bookmarks from Favorites folder
void write(LPCTSTR path) const
write XBEL bookmark file
static bool is_exe_file(LPCTSTR ext)
const FileTypeInfo & operator[](String ext)
LPCTSTR set_type(struct Entry *entry, bool dont_hide_ext=false)
const Icon & add(HICON hIcon, ICON_TYPE type=IT_DYNAMIC)
const Icon & extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
const Icon & get_icon(int icon_id)
HIMAGELIST _himlSys_small
void free_icon(int icon_id)
window class with specified icon from resources
void draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const
HBITMAP create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const
int add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const
static HWND Create(const ExplorerCmd &cmd)
OLE initialisation for drag drop support.
draw message routing for ColorButton and PictureButton
convenient loading of icon resources with specified sizes
ResIconEx(UINT nid, int w, int h)
convenient loading of standard (32x32) icon resources
convenient loading of string resources
convenient loading of small (16x16) icon resources
file system path of special folder
bool write_file(LPCTSTR path, WRITE_MODE mode=FORMAT_SMART) const
bool read_file(LPCTSTR path)
XS_String str() const
return merged error strings
void smart_create(const XS_String &child_name)
create node if not already existing and move to it
bool create_relative(const XPath &xpath)
create child nodes using XPath notation and move to the deepest child
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
#define INVALID_FILE_ATTRIBUTES
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
HWND WINAPI GetShellWindow(VOID)
#define STD_OUTPUT_HANDLE
#define GetFileAttributes
#define EVENT_MODIFY_STATE
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
#define OutputDebugString
#define GetModuleFileName
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define SetWindowFont(hwnd, hfont, fRedraw)
#define SelectBitmap(hdc, hbm)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI DeleteDC(_In_ HDC)
#define HKEY_LOCAL_MACHINE
#define HKEY_CURRENT_USER
#define HKEY_CLASSES_ROOT
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define RegisterClipboardFormat
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI IsIconic(_In_ HWND)
HWND WINAPI GetDesktopWindow(void)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
SHORT WINAPI GetAsyncKeyState(_In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI DestroyIcon(_In_ HICON)