2006-11-08 11:47:44 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Services
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2015-09-09 13:13:35 +00:00
|
|
|
* FILE: base/applications/mscutils/servman/servman.c
|
2006-11-08 11:47:44 +00:00
|
|
|
* PURPOSE: Program HQ
|
|
|
|
* COPYRIGHT: Copyright 2005 - 2006 Ged Murphy <gedmurphy@gmail.com>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
2014-01-07 16:27:17 +00:00
|
|
|
|
|
|
|
#include <winnls.h>
|
|
|
|
|
2006-11-08 11:47:44 +00:00
|
|
|
HINSTANCE hInstance;
|
|
|
|
HANDLE ProcessHeap;
|
2015-04-08 17:30:38 +00:00
|
|
|
HWND g_hProgDlg;
|
2006-11-08 11:47:44 +00:00
|
|
|
|
|
|
|
int WINAPI
|
2015-04-08 17:30:38 +00:00
|
|
|
wWinMain(HINSTANCE hThisInstance,
|
2007-03-24 10:38:15 +00:00
|
|
|
HINSTANCE hPrevInstance,
|
2015-04-08 17:30:38 +00:00
|
|
|
LPWSTR lpCmdLine,
|
2007-03-24 10:38:15 +00:00
|
|
|
int nCmdShow)
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
2015-04-08 17:30:38 +00:00
|
|
|
LPWSTR lpAppName;
|
2006-11-08 11:47:44 +00:00
|
|
|
HWND hMainWnd;
|
2018-02-24 17:38:08 +00:00
|
|
|
HACCEL hAccelTable;
|
2006-11-08 11:47:44 +00:00
|
|
|
MSG Msg;
|
|
|
|
int Ret = 1;
|
|
|
|
INITCOMMONCONTROLSEX icex;
|
2020-08-20 15:50:42 +00:00
|
|
|
|
2013-06-16 22:04:48 +00:00
|
|
|
switch (GetUserDefaultUILanguage())
|
2015-04-08 17:30:38 +00:00
|
|
|
{
|
|
|
|
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
|
|
|
|
SetProcessDefaultLayout(LAYOUT_RTL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-11-08 11:47:44 +00:00
|
|
|
|
|
|
|
hInstance = hThisInstance;
|
|
|
|
ProcessHeap = GetProcessHeap();
|
|
|
|
|
|
|
|
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
|
2016-04-03 22:13:01 +00:00
|
|
|
icex.dwICC = ICC_WIN95_CLASSES | ICC_COOL_CLASSES;
|
2006-11-08 11:47:44 +00:00
|
|
|
InitCommonControlsEx(&icex);
|
|
|
|
|
|
|
|
if (!AllocAndLoadString(&lpAppName,
|
|
|
|
hInstance,
|
|
|
|
IDS_APPNAME))
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2018-02-24 17:38:08 +00:00
|
|
|
hAccelTable = LoadAcceleratorsW(hInstance,
|
|
|
|
MAKEINTRESOURCEW(IDA_SERVMAN));
|
|
|
|
|
2006-11-08 11:47:44 +00:00
|
|
|
if (InitMainWindowImpl())
|
|
|
|
{
|
|
|
|
hMainWnd = CreateMainWindow(lpAppName,
|
|
|
|
nCmdShow);
|
|
|
|
if (hMainWnd != NULL)
|
|
|
|
{
|
|
|
|
/* pump the message queue */
|
2015-04-08 17:30:38 +00:00
|
|
|
while (GetMessageW( &Msg, NULL, 0, 0 ) )
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
2012-05-28 20:12:21 +00:00
|
|
|
//if ( !hProgDlg || !IsWindow(hProgDlg) || !IsDialogMessage(hProgDlg, &Msg) )
|
2015-04-08 17:30:38 +00:00
|
|
|
//if (!IsDialogMessage(g_hProgDlg, &Msg))
|
2018-02-24 17:38:08 +00:00
|
|
|
if (!TranslateAcceleratorW(hMainWnd, hAccelTable, &Msg))
|
2015-04-08 17:30:38 +00:00
|
|
|
{
|
2006-11-08 11:47:44 +00:00
|
|
|
TranslateMessage(&Msg);
|
2015-04-08 17:30:38 +00:00
|
|
|
DispatchMessageW(&Msg);
|
|
|
|
}
|
2006-11-08 11:47:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Ret = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
UninitMainWindowImpl();
|
|
|
|
}
|
|
|
|
|
|
|
|
LocalFree((HLOCAL)lpAppName);
|
|
|
|
|
|
|
|
return Ret;
|
|
|
|
}
|