[BTRFS]
[reactos.git] / reactos / base / applications / mscutils / servman / servman.c
1 /*
2 * PROJECT: ReactOS Services
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/applications/mscutils/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 HWND g_hProgDlg;
17
18 int WINAPI
19 wWinMain(HINSTANCE hThisInstance,
20 HINSTANCE hPrevInstance,
21 LPWSTR lpCmdLine,
22 int nCmdShow)
23 {
24 LPWSTR lpAppName;
25 HWND hMainWnd;
26 MSG Msg;
27 int Ret = 1;
28 INITCOMMONCONTROLSEX icex;
29
30 switch (GetUserDefaultUILanguage())
31 {
32 case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
33 SetProcessDefaultLayout(LAYOUT_RTL);
34 break;
35
36 default:
37 break;
38 }
39
40 hInstance = hThisInstance;
41 ProcessHeap = GetProcessHeap();
42
43 icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
44 icex.dwICC = ICC_WIN95_CLASSES | ICC_COOL_CLASSES;
45 InitCommonControlsEx(&icex);
46
47 if (!AllocAndLoadString(&lpAppName,
48 hInstance,
49 IDS_APPNAME))
50 {
51 return 1;
52 }
53
54 if (InitMainWindowImpl())
55 {
56 hMainWnd = CreateMainWindow(lpAppName,
57 nCmdShow);
58 if (hMainWnd != NULL)
59 {
60 /* pump the message queue */
61 while (GetMessageW( &Msg, NULL, 0, 0 ) )
62 {
63 //if ( !hProgDlg || !IsWindow(hProgDlg) || !IsDialogMessage(hProgDlg, &Msg) )
64 //if (!IsDialogMessage(g_hProgDlg, &Msg))
65 {
66 TranslateMessage(&Msg);
67 DispatchMessageW(&Msg);
68 }
69 }
70
71 Ret = 0;
72 }
73
74 UninitMainWindowImpl();
75 }
76
77 LocalFree((HLOCAL)lpAppName);
78
79 return Ret;
80 }