* Sync with trunk r64401.
[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
12 #include <winnls.h>
13
14 HINSTANCE hInstance;
15 HANDLE ProcessHeap;
16
17 int WINAPI
18 _tWinMain(HINSTANCE hThisInstance,
19 HINSTANCE hPrevInstance,
20 LPTSTR lpCmdLine,
21 int nCmdShow)
22 {
23 LPTSTR lpAppName;
24 HWND hMainWnd;
25 MSG Msg;
26 int Ret = 1;
27 INITCOMMONCONTROLSEX icex;
28
29 switch (GetUserDefaultUILanguage())
30 {
31 case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
32 SetProcessDefaultLayout(LAYOUT_RTL);
33 break;
34
35 default:
36 break;
37 }
38
39 hInstance = hThisInstance;
40 ProcessHeap = GetProcessHeap();
41
42 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
43 icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
44 InitCommonControlsEx(&icex);
45
46 if (!AllocAndLoadString(&lpAppName,
47 hInstance,
48 IDS_APPNAME))
49 {
50 return 1;
51 }
52
53 if (InitMainWindowImpl())
54 {
55 hMainWnd = CreateMainWindow(lpAppName,
56 nCmdShow);
57 if (hMainWnd != NULL)
58 {
59 /* pump the message queue */
60 while( GetMessage( &Msg, NULL, 0, 0 ) )
61 {
62 //if ( !hProgDlg || !IsWindow(hProgDlg) || !IsDialogMessage(hProgDlg, &Msg) )
63 //{
64 TranslateMessage(&Msg);
65 DispatchMessage(&Msg);
66 //}
67 }
68
69 Ret = 0;
70 }
71
72 UninitMainWindowImpl();
73 }
74
75 LocalFree((HLOCAL)lpAppName);
76
77 return Ret;
78 }