2006-11-08 11:47:44 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Device Managment
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
|
|
|
* FILE: base/system/devmgmt/devmgmt.c
|
|
|
|
* PURPOSE: Program HQ
|
|
|
|
* COPYRIGHT: Copyright 2006 Ged Murphy <gedmurphy@gmail.com>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
|
|
|
|
|
|
|
HINSTANCE hInstance;
|
|
|
|
HANDLE ProcessHeap;
|
2007-09-06 19:45:26 +00:00
|
|
|
HANDLE hMutex;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
|
|
|
int WINAPI
|
2007-03-24 10:38:15 +00:00
|
|
|
_tWinMain(HINSTANCE hThisInstance,
|
|
|
|
HINSTANCE hPrevInstance,
|
|
|
|
LPTSTR lpCmdLine,
|
|
|
|
int nCmdShow)
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
|
|
|
LPTSTR lpAppName;
|
|
|
|
HWND hMainWnd;
|
|
|
|
MSG Msg;
|
|
|
|
int Ret = 1;
|
|
|
|
INITCOMMONCONTROLSEX icex;
|
|
|
|
|
2007-09-06 19:45:26 +00:00
|
|
|
hMutex = CreateMutex(NULL, TRUE, _T("devmgmt_mutex"));
|
|
|
|
if (hMutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS)
|
|
|
|
{
|
|
|
|
if (hMutex)
|
|
|
|
{
|
|
|
|
CloseHandle(hMutex);
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2013-06-16 22:04:48 +00:00
|
|
|
|
|
|
|
switch (GetUserDefaultUILanguage())
|
|
|
|
{
|
|
|
|
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
|
|
|
|
SetProcessDefaultLayout(LAYOUT_RTL);
|
|
|
|
break;
|
2007-09-06 19:45:26 +00:00
|
|
|
|
2013-06-16 22:04:48 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-11-08 11:47:44 +00:00
|
|
|
hInstance = hThisInstance;
|
|
|
|
ProcessHeap = GetProcessHeap();
|
|
|
|
|
|
|
|
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
|
|
|
icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
|
|
|
|
InitCommonControlsEx(&icex);
|
|
|
|
|
|
|
|
if (!AllocAndLoadString(&lpAppName,
|
|
|
|
hInstance,
|
|
|
|
IDS_APPNAME))
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (InitMainWindowImpl())
|
|
|
|
{
|
|
|
|
hMainWnd = CreateMainWindow(lpAppName,
|
|
|
|
nCmdShow);
|
|
|
|
if (hMainWnd != NULL)
|
|
|
|
{
|
|
|
|
/* pump the message queue */
|
|
|
|
while( GetMessage( &Msg, NULL, 0, 0 ) )
|
|
|
|
{
|
|
|
|
TranslateMessage(&Msg);
|
|
|
|
DispatchMessage(&Msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Ret = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
UninitMainWindowImpl();
|
|
|
|
}
|
|
|
|
|
|
|
|
LocalFree((HLOCAL)lpAppName);
|
2007-09-06 19:45:26 +00:00
|
|
|
CloseHandle(hMutex);
|
2006-11-08 11:47:44 +00:00
|
|
|
return Ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|