Sync with trunk.
[reactos.git] / base / applications / mscutils / servman / servman.c
1 /*
2 * PROJECT: ReactOS Services
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/system/servman/servman.c
5 * PURPOSE: Program HQ
6 * COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>
7 *
8 */
9
10 #include "precomp.h"
11 HINSTANCE hInstance;
12 HANDLE ProcessHeap;
13
14 int WINAPI
15 _tWinMain(HINSTANCE hThisInstance,
16 HINSTANCE hPrevInstance,
17 LPTSTR lpCmdLine,
18 int nCmdShow)
19 {
20 LPTSTR lpAppName;
21 HWND hMainWnd;
22 MSG Msg;
23 int Ret = 1;
24 INITCOMMONCONTROLSEX icex;
25
26 switch (GetUserDefaultUILanguage())
27 {
28 case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
29 SetProcessDefaultLayout(LAYOUT_RTL);
30 break;
31
32 default:
33 break;
34 }
35
36 hInstance = hThisInstance;
37 ProcessHeap = GetProcessHeap();
38
39 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
40 icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
41 InitCommonControlsEx(&icex);
42
43 if (!AllocAndLoadString(&lpAppName,
44 hInstance,
45 IDS_APPNAME))
46 {
47 return 1;
48 }
49
50 if (InitMainWindowImpl())
51 {
52 hMainWnd = CreateMainWindow(lpAppName,
53 nCmdShow);
54 if (hMainWnd != NULL)
55 {
56 /* pump the message queue */
57 while( GetMessage( &Msg, NULL, 0, 0 ) )
58 {
59 //if ( !hProgDlg || !IsWindow(hProgDlg) || !IsDialogMessage(hProgDlg, &Msg) )
60 //{
61 TranslateMessage(&Msg);
62 DispatchMessage(&Msg);
63 //}
64 }
65
66 Ret = 0;
67 }
68
69 UninitMainWindowImpl();
70 }
71
72 LocalFree((HLOCAL)lpAppName);
73
74 return Ret;
75 }