3 #include "MainWindow.h"
5 HINSTANCE g_hInstance
= NULL
;
6 HANDLE ProcessHeap
= NULL
;
9 wWinMain(HINSTANCE hThisInstance
,
10 HINSTANCE hPrevInstance
,
14 CMainWindow MainWindow
;
15 INITCOMMONCONTROLSEX icex
;
21 /* Check if the app is already running */
22 hMutex
= CreateMutexW(NULL
, TRUE
, L
"devmgmt_mutex");
23 if (hMutex
== NULL
|| GetLastError() == ERROR_ALREADY_EXISTS
)
25 /* Cleanup and exit */
26 if (hMutex
) CloseHandle(hMutex
);
30 /* Store the global values */
31 g_hInstance
= hThisInstance
;
32 ProcessHeap
= GetProcessHeap();
34 /* Initialize common controls */
35 icex
.dwSize
= sizeof(INITCOMMONCONTROLSEX
);
36 icex
.dwICC
= ICC_BAR_CLASSES
| ICC_COOL_CLASSES
;
37 InitCommonControlsEx(&icex
);
39 /* Load the application name */
40 if (szAppName
.LoadStringW(g_hInstance
, IDS_APPNAME
))
42 /* Initialize the main window */
43 if (MainWindow
.Initialize(szAppName
,
46 /* Run the application */
47 Ret
= MainWindow
.Run();
49 /* Uninitialize the main window */
50 MainWindow
.Uninitialize();
54 /* Delete the app mutex */