ReactOS  0.4.12-dev-14-gd0c8636
servman.c
Go to the documentation of this file.
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 
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  HACCEL hAccelTable;
27  MSG Msg;
28  int Ret = 1;
30 
31  switch (GetUserDefaultUILanguage())
32  {
35  break;
36 
37  default:
38  break;
39  }
40 
41  hInstance = hThisInstance;
42  ProcessHeap = GetProcessHeap();
43 
44  icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
46  InitCommonControlsEx(&icex);
47 
48  if (!AllocAndLoadString(&lpAppName,
49  hInstance,
50  IDS_APPNAME))
51  {
52  return 1;
53  }
54 
55  hAccelTable = LoadAcceleratorsW(hInstance,
57 
58  if (InitMainWindowImpl())
59  {
60  hMainWnd = CreateMainWindow(lpAppName,
61  nCmdShow);
62  if (hMainWnd != NULL)
63  {
64  /* pump the message queue */
65  while (GetMessageW( &Msg, NULL, 0, 0 ) )
66  {
67  //if ( !hProgDlg || !IsWindow(hProgDlg) || !IsDialogMessage(hProgDlg, &Msg) )
68  //if (!IsDialogMessage(g_hProgDlg, &Msg))
69  if (!TranslateAcceleratorW(hMainWnd, hAccelTable, &Msg))
70  {
71  TranslateMessage(&Msg);
72  DispatchMessageW(&Msg);
73  }
74  }
75 
76  Ret = 0;
77  }
78 
80  }
81 
82  LocalFree((HLOCAL)lpAppName);
83 
84  return Ret;
85 }
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: lang.c:561
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define LAYOUT_RTL
Definition: wingdi.h:1352
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define SUBLANG_DEFAULT
Definition: nls.h:168
HWND g_hProgDlg
Definition: servman.c:16
HINSTANCE hInstance
Definition: servman.c:14
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define LANG_HEBREW
Definition: nls.h:67
struct @1571 Msg[]
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define ICC_COOL_CLASSES
Definition: commctrl.h:69
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
smooth NULL
Definition: ftsmooth.c:416
HANDLE ProcessHeap
Definition: servman.c:15
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition: window.c:1686
#define GetProcessHeap()
Definition: compat.h:395
VOID UninitMainWindowImpl(VOID)
Definition: mainwnd.c:987
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
HWND hMainWnd
Definition: magnifier.c:33
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define WINAPI
Definition: msvc.h:20
int WINAPI wWinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
Definition: servman.c:19
#define IDS_APPNAME
Definition: resource.h:49
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define MAKELANGID(p, s)
Definition: nls.h:15
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
BOOL InitMainWindowImpl(VOID)
Definition: mainwnd.c:961
HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow)
Definition: mainwnd.c:920
#define IDA_SERVMAN
Definition: resource.h:5