ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

devmgmt.cpp
Go to the documentation of this file.
00001 #include "stdafx.h"
00002 #include "devmgmt.h"
00003 #include "MainWindow.h"
00004 
00005 HINSTANCE g_hInstance = NULL;
00006 HANDLE ProcessHeap = NULL;
00007 
00008 int WINAPI
00009 wWinMain(HINSTANCE hThisInstance,
00010          HINSTANCE hPrevInstance,
00011          LPWSTR lpCmdLine,
00012          int nCmdShow)
00013 {
00014     CMainWindow MainWindow;
00015     INITCOMMONCONTROLSEX icex;
00016     HANDLE hMutex;
00017     CAtlString szAppName;
00018 
00019     int Ret = 1;
00020 
00021     /* Check if the app is already running */
00022     hMutex = CreateMutexW(NULL, TRUE, L"devmgmt_mutex");
00023     if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
00024     {
00025         /* Cleanup and exit */
00026         if (hMutex) CloseHandle(hMutex);
00027         return 0;
00028     }
00029 
00030     /* Store the global values */
00031     g_hInstance = hThisInstance;
00032     ProcessHeap = GetProcessHeap();
00033 
00034     /* Initialize common controls */
00035     icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00036     icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
00037     InitCommonControlsEx(&icex);
00038 
00039     /* Load the application name */
00040     if (szAppName.LoadStringW(g_hInstance, IDS_APPNAME))
00041     {
00042         /* Initialize the main window */
00043         if (MainWindow.Initialize(szAppName,
00044                                   nCmdShow))
00045         {
00046             /* Run the application */
00047             Ret = MainWindow.Run();
00048 
00049             /* Uninitialize the main window */
00050             MainWindow.Uninitialize();
00051         }
00052     }
00053 
00054     /* Delete the app mutex */
00055     CloseHandle(hMutex);
00056 
00057     return Ret;
00058 }

Generated on Mon May 28 2012 04:16:54 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.