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.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     ReactOS Device Managment
00003  * LICENSE:     GPL - See COPYING in the top level directory
00004  * FILE:        base/system/devmgmt/devmgmt.c
00005  * PURPOSE:     Program HQ
00006  * COPYRIGHT:   Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
00007  *
00008  */
00009 
00010 #include "precomp.h"
00011 
00012 HINSTANCE hInstance;
00013 HANDLE ProcessHeap;
00014 HANDLE hMutex;
00015 
00016 int WINAPI
00017 _tWinMain(HINSTANCE hThisInstance,
00018           HINSTANCE hPrevInstance,
00019           LPTSTR lpCmdLine,
00020           int nCmdShow)
00021 {
00022     LPTSTR lpAppName;
00023     HWND hMainWnd;
00024     MSG Msg;
00025     int Ret = 1;
00026     INITCOMMONCONTROLSEX icex;
00027 
00028     hMutex = CreateMutex(NULL, TRUE, _T("devmgmt_mutex"));
00029     if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
00030     {
00031         if (hMutex)
00032         {
00033             CloseHandle(hMutex);
00034         }
00035         return 0;
00036     }
00037 
00038     hInstance = hThisInstance;
00039     ProcessHeap = GetProcessHeap();
00040 
00041     icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
00042     icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
00043     InitCommonControlsEx(&icex);
00044 
00045     if (!AllocAndLoadString(&lpAppName,
00046                             hInstance,
00047                             IDS_APPNAME))
00048     {
00049         return 1;
00050     }
00051 
00052     if (InitMainWindowImpl())
00053     {
00054         hMainWnd = CreateMainWindow(lpAppName,
00055                                     nCmdShow);
00056         if (hMainWnd != NULL)
00057         {
00058             /* pump the message queue */
00059             while( GetMessage( &Msg, NULL, 0, 0 ) )
00060             {
00061                 TranslateMessage(&Msg);
00062                 DispatchMessage(&Msg);
00063 
00064             }
00065 
00066             Ret = 0;
00067         }
00068 
00069         UninitMainWindowImpl();
00070     }
00071 
00072     LocalFree((HLOCAL)lpAppName);
00073     CloseHandle(hMutex);
00074     return Ret;
00075 }
00076 
00077 
00078 

Generated on Sat May 26 2012 04:15:51 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.