ReactOS
0.4.15-dev-2103-g9dff498
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
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
HACCEL hAccelTable;
27
MSG
Msg
;
28
int
Ret = 1;
29
INITCOMMONCONTROLSEX
icex;
30
31
switch
(
GetUserDefaultUILanguage
())
32
{
33
case
MAKELANGID
(
LANG_HEBREW
,
SUBLANG_DEFAULT
):
34
SetProcessDefaultLayout
(
LAYOUT_RTL
);
35
break
;
36
37
default
:
38
break
;
39
}
40
41
hInstance
= hThisInstance;
42
ProcessHeap
=
GetProcessHeap
();
43
44
icex.
dwSize
=
sizeof
(
INITCOMMONCONTROLSEX
);
45
icex.
dwICC
=
ICC_WIN95_CLASSES
|
ICC_COOL_CLASSES
;
46
InitCommonControlsEx
(&icex);
47
48
if
(!
AllocAndLoadString
(&lpAppName,
49
hInstance
,
50
IDS_APPNAME
))
51
{
52
return
1;
53
}
54
55
hAccelTable =
LoadAcceleratorsW
(
hInstance
,
56
MAKEINTRESOURCEW
(
IDA_SERVMAN
));
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
79
UninitMainWindowImpl
();
80
}
81
82
LocalFree
((
HLOCAL
)lpAppName);
83
84
return
Ret;
85
}
GetUserDefaultUILanguage
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition:
lang.c:806
TranslateMessage
BOOL WINAPI TranslateMessage(_In_ const MSG *)
precomp.h
LAYOUT_RTL
#define LAYOUT_RTL
Definition:
wingdi.h:1370
tagINITCOMMONCONTROLSEX::dwICC
DWORD dwICC
Definition:
commctrl.h:56
Msg
struct @1616 Msg[]
MSG
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition:
twain.h:1827
SUBLANG_DEFAULT
#define SUBLANG_DEFAULT
Definition:
nls.h:168
g_hProgDlg
HWND g_hProgDlg
Definition:
servman.c:16
hInstance
HINSTANCE hInstance
Definition:
servman.c:14
AllocAndLoadString
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition:
misc.c:60
INITCOMMONCONTROLSEX
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
LANG_HEBREW
#define LANG_HEBREW
Definition:
nls.h:67
ICC_WIN95_CLASSES
#define ICC_WIN95_CLASSES
Definition:
commctrl.h:66
DispatchMessageW
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
ICC_COOL_CLASSES
#define ICC_COOL_CLASSES
Definition:
commctrl.h:69
LoadAcceleratorsW
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
ProcessHeap
HANDLE ProcessHeap
Definition:
servman.c:15
SetProcessDefaultLayout
BOOL WINAPI SetProcessDefaultLayout(DWORD dwDefaultLayout)
Definition:
window.c:1720
GetProcessHeap
#define GetProcessHeap()
Definition:
compat.h:595
winnls.h
WINAPI
#define WINAPI
Definition:
msvc.h:6
UninitMainWindowImpl
VOID UninitMainWindowImpl(VOID)
Definition:
mainwnd.c:992
TranslateAcceleratorW
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
hMainWnd
HWND hMainWnd
Definition:
magnifier.c:32
InitCommonControlsEx
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition:
commctrl.c:893
wWinMain
int WINAPI wWinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
Definition:
servman.c:19
tagINITCOMMONCONTROLSEX
Definition:
commctrl.h:54
IDS_APPNAME
#define IDS_APPNAME
Definition:
resource.h:49
tagINITCOMMONCONTROLSEX::dwSize
DWORD dwSize
Definition:
commctrl.h:55
LocalFree
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition:
heapmem.c:1577
NULL
#define NULL
Definition:
types.h:112
GetMessageW
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
MAKELANGID
#define MAKELANGID(p, s)
Definition:
nls.h:15
MAKEINTRESOURCEW
#define MAKEINTRESOURCEW(i)
Definition:
winuser.h:582
LPWSTR
WCHAR * LPWSTR
Definition:
xmlstorage.h:184
void
Definition:
nsiface.idl:2306
InitMainWindowImpl
BOOL InitMainWindowImpl(VOID)
Definition:
mainwnd.c:966
CreateMainWindow
HWND CreateMainWindow(LPCTSTR lpCaption, int nCmdShow)
Definition:
mainwnd.c:925
IDA_SERVMAN
#define IDA_SERVMAN
Definition:
resource.h:5
base
applications
mscutils
servman
servman.c
Generated on Mon Mar 1 2021 06:03:16 for ReactOS by
1.8.15