ReactOS  0.4.12-dev-75-g00dd17e
explorer.cpp File Reference
#include <precomp.h>
#include <shlwapi.h>
#include <locale.h>
#include <io.h>
#include <fcntl.h>
#include "services/shellservices.h"
Include dependency graph for explorer.cpp:

Go to the source code of this file.

Classes

struct  ExplorerAboutDlg
 "About Explorer" Dialog More...
 

Functions

int initialize_gdb_stub ()
 
void _log_ (LPCTSTR txt)
 
HBITMAP create_bitmap_from_icon (HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
 create a bitmap from an icon More...
 
HBITMAP create_small_bitmap_from_icon (HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
 
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 More...
 
void SetWindowIcon (HWND hwnd, UINT nid)
 set big and small icons out of the resources for a window More...
 
void explorer_show_frame (int cmdShow, LPTSTR lpCmdLine)
 
void explorer_about (HWND hwndParent)
 
static void InitInstance (HINSTANCE hInstance)
 
int explorer_main (HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
 
static bool SetShellReadyEvent (LPCTSTR evtName)
 
int WINAPI _tWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nShowCmd)
 

Variables

DynamicLoadLibFct< void(__stdcall *)(BOOL)> g_SHDOCVW_ShellDDEInit (TEXT("SHDOCVW"), 118)
 
ExplorerGlobals g_Globals
 
boolean SelectOpt =FALSE
 

Function Documentation

◆ _log_()

void _log_ ( LPCTSTR  txt)

Definition at line 139 of file explorer.cpp.

140 {
141  FmtString msg(TEXT("%s\n"), txt);
142 
143  if (g_Globals._log)
145 
147 }
#define _fputts
Definition: tchar.h:569
#define OutputDebugString
Definition: winbase.h:3704
UINT msg
Definition: msvc.h:92
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define TEXT(s)
Definition: k32.h:26
#define msg(x)
Definition: auth_time.c:54
FILE * _log
Definition: globals.h:280

◆ _tWinMain()

int WINAPI _tWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPTSTR  lpCmdLine,
int  nShowCmd 
)
Todo:
save previous shell application in config file
Todo:
save previous shell application in config file

TODO launching autostart programs can be moved into a background thread.

Definition at line 1006 of file explorer.cpp.

1007 {
1008  CONTEXT("WinMain()");
1009 
1010  BOOL any_desktop_running = IsAnyDesktopRunning();
1011 
1012  BOOL startup_desktop;
1013 
1014  // strip extended options from the front of the command line
1015  String ext_options;
1016 
1017  while(*lpCmdLine == '-') {
1018  while(*lpCmdLine && !_istspace((unsigned)*lpCmdLine))
1019  ext_options += *lpCmdLine++;
1020 
1021  while(_istspace((unsigned)*lpCmdLine))
1022  ++lpCmdLine;
1023  }
1024 
1025  // command line option "-install" to replace previous shell application with ROS Explorer
1026  if (_tcsstr(ext_options,TEXT("-install"))) {
1027  // install ROS Explorer into the registry
1028  TCHAR path[MAX_PATH];
1029 
1030  int l = GetModuleFileName(0, path, COUNTOF(path));
1031  if (l) {
1032  HKEY hkey;
1033 
1034  if (!RegOpenKey(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) {
1035 
1037 
1038  RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)path, l*sizeof(TCHAR));
1039  RegCloseKey(hkey);
1040  }
1041 
1042  if (!RegOpenKey(HKEY_CURRENT_USER, TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon"), &hkey)) {
1043 
1045 
1046  RegSetValueEx(hkey, TEXT("Shell"), 0, REG_SZ, (LPBYTE)TEXT(""), l*sizeof(TCHAR));
1047  RegCloseKey(hkey);
1048  }
1049  }
1050 
1051  HWND shellWindow = GetShellWindow();
1052 
1053  if (shellWindow) {
1054  DWORD pid;
1055 
1056  // terminate shell process for NT like systems
1057  GetWindowThreadProcessId(shellWindow, &pid);
1059 
1060  // On Win 9x it's sufficient to destroy the shell window.
1061  DestroyWindow(shellWindow);
1062 
1063  if (TerminateProcess(hProcess, 0))
1064  WaitForSingleObject(hProcess, INFINITE);
1065 
1066  CloseHandle(hProcess);
1067  }
1068 
1069  startup_desktop = TRUE;
1070  } else {
1071  // create desktop window and task bar only, if there is no other shell and we are
1072  // the first explorer instance
1073  // MS Explorer looks additionally into the registry entry HKCU\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\shell,
1074  // to decide wether it is currently configured as shell application.
1075  startup_desktop = !any_desktop_running;
1076  }
1077 
1078 
1079  bool autostart = !any_desktop_running;
1080 
1081  // disable autostart if the SHIFT key is pressed
1082  if (GetAsyncKeyState(VK_SHIFT) < 0)
1083  autostart = false;
1084 
1085 #ifdef _DEBUG //MF: disabled for debugging
1086  autostart = false;
1087 #endif
1088 
1089  // If there is given the command line option "-desktop", create desktop window anyways
1090  if (_tcsstr(ext_options,TEXT("-desktop")))
1091  startup_desktop = TRUE;
1092 #ifndef ROSSHELL
1093  else if (_tcsstr(ext_options,TEXT("-nodesktop")))
1094  startup_desktop = FALSE;
1095 
1096  // Don't display cabinet window in desktop mode
1097  if (startup_desktop && !_tcsstr(ext_options,TEXT("-explorer")))
1098  nShowCmd = SW_HIDE;
1099 #endif
1100 
1101  if (_tcsstr(ext_options,TEXT("-noautostart")))
1102  autostart = false;
1103  else if (_tcsstr(ext_options,TEXT("-autostart")))
1104  autostart = true;
1105 
1106 #ifndef __WINE__
1107  if (_tcsstr(ext_options,TEXT("-console"))) {
1108  AllocConsole();
1109 
1113 
1114  g_Globals._log = _fdopen(1, "w");
1115  setvbuf(g_Globals._log, 0, _IONBF, 0);
1116 
1117  LOG(TEXT("starting explorer debug log\n"));
1118  }
1119 #endif
1120 
1121 
1122  if (startup_desktop) {
1123  // hide the XP login screen (Credit to Nicolas Escuder)
1124  // another undocumented event: "Global\\msgina: ReturnToWelcome"
1125  if (!SetShellReadyEvent(TEXT("msgina: ShellReadyEvent")))
1126  SetShellReadyEvent(TEXT("Global\\msgina: ShellReadyEvent"));
1127  }
1128 #ifdef ROSSHELL
1129  else
1130  return 0; // no shell to launch, so exit immediatelly
1131 #endif
1132 
1133 
1134  if (!any_desktop_running) {
1135  // launch the shell DDE server
1137  (*g_SHDOCVW_ShellDDEInit)(TRUE);
1138  }
1139 
1140 
1141  bool use_gdb_stub = false; // !IsDebuggerPresent();
1142 
1143  if (_tcsstr(ext_options,TEXT("-debug")))
1144  use_gdb_stub = true;
1145 
1146  if (_tcsstr(ext_options,TEXT("-break"))) {
1147  LOG(TEXT("debugger breakpoint"));
1148  __debugbreak();
1149  }
1150 
1151 #ifdef _M_IX86
1152  // activate GDB remote debugging stub if no other debugger is running
1153  if (use_gdb_stub) {
1154  LOG(TEXT("waiting for debugger connection...\n"));
1155 
1157  }
1158 #endif
1159 
1160  g_Globals.init(hInstance);
1161 
1162  // initialize COM and OLE before creating the desktop window
1163  OleInit usingCOM;
1164 
1165  // init common controls library
1166  CommonControlInit usingCmnCtrl;
1167 
1169 
1170  if (startup_desktop) {
1171  WaitCursor wait;
1172 
1174 
1176 #ifdef _USE_HDESK
1177  g_Globals._desktops.get_current_Desktop()->_hwndDesktop = g_Globals._hwndDesktop;
1178 #endif
1179  }
1180 
1181  if (_tcsstr(ext_options,TEXT("-?"))) {
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"
1187  "\r\n"
1188  "-? display command line options\r\n"
1189  "\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"
1193  "\r\n"
1194  "-install replace previous shell application with ROS Explorer\r\n"
1195  "\r\n"
1196  "-noautostart disable autostarts\r\n"
1197  "-autostart enable autostarts regardless of debug build\r\n"
1198  "\r\n"
1199  "-console open debug console\r\n"
1200  "\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);
1204  }
1205 
1206  /*
1207  * Set our shutdown parameters: we want to shutdown the very last,
1208  * but before any TaskMgr instance (which has a shutdown level of 1).
1209  */
1211 
1212  Thread* pSSOThread = NULL;
1213 
1214  if (startup_desktop) {
1215  // launch SSO thread to allow message processing independent from the explorer main thread
1216  pSSOThread = new SSOThread;
1217  pSSOThread->Start();
1218  }
1219 
1221  if (autostart) {
1222  const char* argv[] = {"", "s"}; // call startup routine in SESSION_START mode
1223  startup(2, argv);
1224  }
1225 
1226 #ifndef ROSSHELL
1227  if (g_Globals._hwndDesktop)
1228  g_Globals._desktop_mode = true;
1229 #endif
1230 
1231 
1232  int ret = explorer_main(hInstance, lpCmdLine, nShowCmd);
1233 
1234 
1235  // write configuration file
1237 
1238  if (pSSOThread) {
1239  pSSOThread->Stop();
1240  delete pSSOThread;
1241  }
1242 
1243  if (!any_desktop_running) {
1244  // shutdown the shell DDE server
1246  (*g_SHDOCVW_ShellDDEInit)(FALSE);
1247  }
1248 
1249  return ret;
1250 }
BOOL IsAnyDesktopRunning()
Definition: desktop.cpp:248
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
HWND WINAPI GetShellWindow(VOID)
Definition: desktop.c:651
struct _CONTEXT CONTEXT
#define TRUE
Definition: types.h:120
BOOL WINAPI AllocConsole(VOID)
Definition: console.c:48
#define CloseHandle
Definition: compat.h:398
#define _O_RDONLY
Definition: cabinet.h:37
bool _desktop_mode
Definition: globals.h:276
_Check_return_ _CRTIMP int __cdecl _dup2(_In_ int _FileHandleSrc, _In_ int _FileHandleDst)
#define PROCESS_ALL_ACCESS
Definition: nt_native.h:1324
_Check_return_ _CRTIMP FILE *__cdecl _fdopen(_In_ int _FileHandle, _In_z_ const char *_Mode)
#define SW_HIDE
Definition: winuser.h:762
#define HKEY_CURRENT_USER
Definition: winreg.h:11
void write_persistent()
Definition: explorer.cpp:109
void read_persistent()
Definition: explorer.cpp:84
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
int startup(int argc, const char *argv[])
Definition: startup.c:430
static HWND Create()
Definition: desktop.cpp:326
static WCHAR String[]
Definition: stringtable.c:55
int initialize_gdb_stub()
BOOL WINAPI DestroyWindow(_In_ HWND)
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
static char ** argv
Definition: ServiceArgs.c:11
BOOL WINAPI SetProcessShutdownParameters(IN DWORD dwLevel, IN DWORD dwFlags)
Definition: proc.c:979
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
int explorer_main(HINSTANCE hInstance, LPTSTR lpCmdLine, int cmdShow)
Definition: explorer.cpp:961
void init()
Definition: desktop.cpp:77
#define VK_SHIFT
Definition: winuser.h:2156
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
#define STD_INPUT_HANDLE
Definition: winbase.h:264
OLE initialisation for drag drop support.
Definition: shellclasses.h:201
#define _tcsstr
Definition: xmlstorage.h:199
r l[0]
Definition: byte_order.h:167
char TCHAR
Definition: xmlstorage.h:189
unsigned int BOOL
Definition: ntddk_ex.h:94
#define STD_ERROR_HANDLE
Definition: winbase.h:266
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
#define GetModuleFileName
Definition: winbase.h:3645
DynamicLoadLibFct< void(__stdcall *)(BOOL)> g_SHDOCVW_ShellDDEInit(TEXT("SHDOCVW"), 118)
Definition: explorer.cpp:49
int ret
static bool SetShellReadyEvent(LPCTSTR evtName)
Definition: explorer.cpp:993
void init(HINSTANCE hInstance)
Definition: explorer.cpp:76
SHORT WINAPI GetAsyncKeyState(_In_ int)
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define STD_OUTPUT_HANDLE
Definition: winbase.h:265
#define LOG(txt)
Definition: utility.h:102
HANDLE WINAPI OpenProcess(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN DWORD dwProcessId)
Definition: proc.c:1257
#define TEXT(s)
Definition: k32.h:26
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1562
Definition: services.c:325
#define MB_OK
Definition: winuser.h:784
#define _istspace
Definition: tchar.h:1504
Desktops _desktops
Definition: globals.h:291
_Check_return_opt_ _CRTIMP int __cdecl setvbuf(_Inout_ FILE *_File, _Inout_updates_opt_z_(_Size) char *_Buf, _In_ int _Mode, _In_ size_t _Size)
#define COUNTOF(x)
Definition: utility.h:93
#define _IONBF
Definition: stdio.h:130
_CRTIMP int __cdecl _open_osfhandle(_In_ intptr_t _OSFileHandle, _In_ int _Flags)
#define INFINITE
Definition: serial.h:102
#define RegOpenKey
Definition: winreg.h:519
FILE * _log
Definition: globals.h:280
HWND _hwndDesktop
Definition: globals.h:289
#define RegSetValueEx
Definition: winreg.h:533
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define REG_SZ
Definition: layer.c:22

◆ create_bitmap_from_icon()

HBITMAP create_bitmap_from_icon ( HICON  hIcon,
HBRUSH  hbrush_bkgnd,
HDC  hdc_wnd 
)

create a bitmap from an icon

Definition at line 332 of file explorer.cpp.

Referenced by Icon::create_bitmap(), TaskBar::EnumWndProc(), and ImageList_AddAlphaIcon().

333 {
334  int cx = ICON_SIZE_SMALL;
335  int cy = ICON_SIZE_SMALL;
336  HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
337 
338  MemCanvas canvas;
339  BitmapSelection sel(canvas, hbmp);
340 
341  RECT rect = {0, 0, cx, cy};
342  FillRect(canvas, &rect, hbrush_bkgnd);
343 
344  DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
345 
346  return hbmp;
347 }
#define HBITMAP
Definition: msvc.h:28
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
& rect
Definition: startmenu.cpp:1413
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
#define ICON_SIZE_SMALL
Definition: globals.h:169
#define DI_NORMAL
Definition: wingdi.h:72
HICON hIcon
Definition: msconfig.c:44
_Out_opt_ int * cx
Definition: commctrl.h:570
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBITMAP hbmp
Definition: msvc.h:60

◆ create_small_bitmap_from_icon()

HBITMAP create_small_bitmap_from_icon ( HICON  hIcon,
HBRUSH  hbrush_bkgnd,
HDC  hdc_wnd 
)

Definition at line 349 of file explorer.cpp.

350 {
353  HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy);
354 
355  MemCanvas canvas;
356  BitmapSelection sel(canvas, hbmp);
357 
358  RECT rect = {0, 0, cx, cy};
359  FillRect(canvas, &rect, hbrush_bkgnd);
360 
361  DrawIconEx(canvas, 0, 0, hIcon, cx, cy, 0, hbrush_bkgnd, DI_NORMAL);
362 
363  return hbmp;
364 }
#define HBITMAP
Definition: msvc.h:28
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define SM_CYSMICON
Definition: winuser.h:1003
& rect
Definition: startmenu.cpp:1413
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:1997
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
#define DI_NORMAL
Definition: wingdi.h:72
HICON hIcon
Definition: msconfig.c:44
_Out_opt_ int * cx
Definition: commctrl.h:570
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBITMAP hbmp
Definition: msvc.h:60

◆ explorer_about()

void explorer_about ( HWND  hwndParent)

Definition at line 934 of file explorer.cpp.

Referenced by MainFrameBase::Command(), DesktopBar::Command(), and DesktopShellView::DoDesktopContextMenu().

935 {
937 }
#define WINDOW_CREATOR(WND_CLASS)
Definition: window.h:202
"About Explorer" Dialog
Definition: explorer.cpp:871
#define IDD_ABOUT_EXPLORER
Definition: resource.h:81
static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0)
Definition: window.cpp:701

◆ explorer_main()

int explorer_main ( HINSTANCE  hInstance,
LPTSTR  lpCmdLine,
int  cmdShow 
)

Definition at line 961 of file explorer.cpp.

Referenced by _tWinMain().

962 {
963  CONTEXT("explorer_main");
964 
965  // initialize Common Controls library
966  CommonControlInit usingCmnCtrl;
967 
968  try {
969  InitInstance(hInstance);
970  } catch(COMException& e) {
972  return -1;
973  }
974 
975 #ifndef ROSSHELL
976  if (cmdShow != SW_HIDE) {
977 /* // don't maximize if being called from the ROS desktop
978  if (cmdShow == SW_SHOWNORMAL)
980  cmdShow = SW_MAXIMIZE;
981 */
982 
983  explorer_show_frame(cmdShow, lpCmdLine);
984  }
985 #endif
986 
988 
989  return 1;
990 }
struct _CONTEXT CONTEXT
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
Definition: explorer.cpp:707
#define SW_HIDE
Definition: winuser.h:762
Exception with context information.
Definition: shellclasses.h:113
#define e
Definition: ke_i.h:82
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
static int MessageLoop()
Definition: window.cpp:629
static void InitInstance(HINSTANCE hInstance)
Definition: explorer.cpp:940

◆ explorer_show_frame()

void explorer_show_frame ( int  cmdShow,
LPTSTR  lpCmdLine 
)

Definition at line 707 of file explorer.cpp.

Referenced by DesktopBar::Command(), StartMenuHandler::Command(), explorer_main(), ExplorerCmd::IsValidPath(), DesktopBar::ProcessHotKey(), and DesktopWindow::WndProc().

708 {
710 
711  if (g_Globals._hMainWnd) {
714  else
716 
717  return;
718  }
719 
720  g_Globals._prescan_nodes = false;
721 
722  cmd._mdi = true;
723  cmd._cmdShow = cmdShow;
724 
725  // parse command line options, which may overwrite the MDI flag
726  if (lpCmdLine)
727  cmd.ParseCmdLine(lpCmdLine);
728 
729  // create main window
731 }
bool ParseCmdLine(LPCTSTR lpCmdLine)
Definition: explorer.cpp:733
Explorer command line parser.
Definition: explorer.h:89
char * cmd
Definition: vfdcmd.c:85
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_RESTORE
Definition: winuser.h:773
BOOL WINAPI IsIconic(_In_ HWND)
static HWND Create(const ExplorerCmd &cmd)
Definition: mainframe.cpp:40
bool _prescan_nodes
Definition: globals.h:277
int _cmdShow
Definition: explorer.h:115
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
bool _mdi
Definition: explorer.h:116
HWND _hMainWnd
Definition: globals.h:275
BOOL WINAPI SetForegroundWindow(_In_ HWND)

◆ ImageList_AddAlphaIcon()

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

Definition at line 366 of file explorer.cpp.

Referenced by Icon::add_to_imagelist(), MainFrameBase::FillBookmarks(), TrayNotifyDlg::InsertItem(), and TrayNotifyDlg::TrayNotifyDlg().

367 {
368  HBITMAP hbmp = create_bitmap_from_icon(hIcon, hbrush_bkgnd, hdc_wnd);
369 
370  int ret = ImageList_Add(himl, hbmp, 0);
371 
372  DeleteObject(hbmp);
373 
374  return ret;
375 }
#define HBITMAP
Definition: msvc.h:28
INT WINAPI ImageList_Add(HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
Definition: imagelist.c:413
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
int ret
HICON hIcon
Definition: msconfig.c:44
HBITMAP create_bitmap_from_icon(HICON hIcon, HBRUSH hbrush_bkgnd, HDC hdc_wnd)
create a bitmap from an icon
Definition: explorer.cpp:332
HBITMAP hbmp
Definition: msvc.h:60

◆ initialize_gdb_stub()

int initialize_gdb_stub ( )

Referenced by _tWinMain(), and breakpoint().

◆ InitInstance()

static void InitInstance ( HINSTANCE  hInstance)
static

Definition at line 940 of file explorer.cpp.

Referenced by explorer_main().

941 {
942  CONTEXT("InitInstance");
943 
944  setlocale(LC_COLLATE, ""); // set collating rules to local settings for compareName
945 
946 #ifndef ROSSHELL
947  // register frame window class
949 
950  // register child window class
952 
953  // register tree window class
955 #endif
956 
958 }
ATOM _hframeClass
Definition: globals.h:274
struct _CONTEXT CONTEXT
#define IDI_EXPLORER
Definition: resource.h:56
#define CLASSNAME_WINEFILETREE
Definition: explorer.h:76
#define CLASSNAME_CHILDWND
Definition: explorer.h:75
#define CFSTR_FILENAME
Definition: shlobj.h:459
UINT _cfStrFName
Definition: globals.h:271
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
#define CS_DBLCLKS
Definition: winuser.h:646
#define RegisterClipboardFormat
Definition: winuser.h:5704
window class with specified icon from resources
Definition: window.h:258
#define CS_CLASSDC
Definition: winuser.h:645
#define CLASSNAME_FRAME
Definition: explorer.h:73
#define LC_COLLATE
Definition: locale.h:26
ATOM Register()
Definition: window.h:230
#define setlocale(n, s)
Definition: locale.h:46

◆ SetShellReadyEvent()

static bool SetShellReadyEvent ( LPCTSTR  evtName)
static

Definition at line 993 of file explorer.cpp.

Referenced by _tWinMain().

994 {
996  if (!hEvent)
997  return false;
998 
999  SetEvent(hEvent);
1000  CloseHandle(hEvent);
1001 
1002  return true;
1003 }
#define CloseHandle
Definition: compat.h:398
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
#define OpenEvent
Definition: winbase.h:3699
static HANDLE hEvent
Definition: comm.c:54
#define EVENT_MODIFY_STATE
Definition: winbase.h:163

◆ SetWindowIcon()

void SetWindowIcon ( HWND  hwnd,
UINT  nid 
)

set big and small icons out of the resources for a window

Definition at line 689 of file explorer.cpp.

Referenced by DesktopBar::DesktopBar(), ExplorerAboutDlg::ExplorerAboutDlg(), FindProgramDlg::FindProgramDlg(), and TrayNotifyDlg::TrayNotifyDlg().

690 {
691  HICON hIcon = ResIcon(nid);
692  (void)Window_SetIcon(hwnd, ICON_BIG, hIcon);
693 
694  HICON hIconSmall = SmallIcon(nid);
695  (void)Window_SetIcon(hwnd, ICON_SMALL, hIconSmall);
696 }
static HICON
Definition: imagelist.c:84
convenient loading of standard (32x32) icon resources
Definition: globals.h:309
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
NOTIFYICONDATA nid
Definition: magnifier.c:45
#define ICON_SMALL
Definition: tnclass.cpp:48
#define Window_SetIcon(hwnd, type, hicon)
Definition: utility.h:155
convenient loading of small (16x16) icon resources
Definition: globals.h:320
HICON hIcon
Definition: msconfig.c:44
#define ICON_BIG
Definition: tnclass.cpp:51

Variable Documentation

◆ g_Globals

ExplorerGlobals g_Globals

Definition at line 52 of file explorer.cpp.

Referenced by StartMenu::AddButton(), SettingsMenu::AddEntries(), BrowseMenu::AddEntries(), SearchMenu::AddEntries(), FavoritesMenu::AddEntries(), QuickLaunchBar::AddShortcuts(), DesktopSettingsDlg::Command(), TaskbarSettingsDlg::Command(), MainFrameBase::Command(), MdiSdiDlg::Command(), DesktopBar::Command(), StartMenuHandler::Command(), MainFrameBase::Create(), Window::Create(), FileChildWindow::create(), MDIMainFrame::Create(), SDIMainFrame::Create(), ChildWindow::create(), Pane::create_header(), DesktopSettingsDlg::DesktopSettingsDlg(), Dialog::DoModal(), Pane::draw_item(), Entry::extract_icon(), BookmarkList::fill_tree(), ShellDirectory::fill_w32fdata_shell(), MainFrameBase::FillBookmarks(), FindProgramDlg::FindProgramDlg(), ShellBrowser::get_image_idx(), DesktopWindow::Init(), Pane::init(), DesktopBar::Init(), StartMenuRoot::Init(), ShellBrowser::InsertSubitems(), ShellBrowser::invalidate_cache(), MainFrameBase::MainFrameBase(), MDIMainFrame::MDIMainFrame(), MdiSdiDlg::MdiSdiDlg(), MinimizeDesktopEnumFct(), DesktopSettingsDlg::Notify(), TaskbarSettingsDlg::Notify(), FindProgramDlg::Notify(), MainFrameBase::OpenShellFolders(), DesktopBar::ProcessHotKey(), MainFrameBase::ProcessMessage(), PropertySheetDialog::PropertySheetDialog(), PropSheetPage::PropSheetPage(), Favorites::read(), NotifyArea::read_config(), WinDirectory::read_directory(), ShellDirectory::read_directory(), Entry::read_directory_base(), TrayNotifyDlg::RefreshProperties(), StartMenuRoot::StartMenuRoot(), SwitchDesktopEnumFct(), Desktops::SwitchToDesktop(), TaskbarSettingsDlg::TaskbarSettingsDlg(), TrayNotifyDlg::TrayNotifyDlg(), SDIMainFrame::update_shell_browser(), MDIShellBrowserChild::update_shell_browser(), WindowClass::WindowClass(), BackgroundWindow::WndProc(), DesktopWindow::WndProc(), NotifyArea::write_config(), Entry::~Entry(), and MainFrameBase::~MainFrameBase().

◆ g_SHDOCVW_ShellDDEInit

DynamicLoadLibFct<void(__stdcall*)(BOOL)> g_SHDOCVW_ShellDDEInit(TEXT("SHDOCVW"), 118)

Definition at line 49 of file explorer.cpp.

Referenced by _tWinMain().

◆ SelectOpt

boolean SelectOpt =FALSE

Definition at line 53 of file explorer.cpp.