[NTDLL]
[reactos.git] / base / applications / mmc / mmc.c
1 /*
2 * ReactOS Management Console
3 * Copyright (C) 2006 - 2007 Thomas Weidenmueller
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20 #include "precomp.h"
21
22 HINSTANCE hAppInstance;
23 HANDLE hAppHeap;
24
25 int
26 _tmain(IN int argc,
27 IN const TCHAR *argv[])
28 {
29 HWND hMainConsole;
30 MSG Msg;
31 BOOL bRet;
32
33 hAppInstance = GetModuleHandle(NULL);
34 hAppHeap = GetProcessHeap();
35
36 InitCommonControls();
37
38 if (!RegisterMMCWndClasses())
39 {
40 /* FIXME - Display error */
41 return 1;
42 }
43
44 hMainConsole = CreateConsoleWindow(argc > 1 ? argv[1] : NULL);
45 if (hMainConsole != NULL)
46 {
47 for (;;)
48 {
49 bRet = GetMessage(&Msg,
50 NULL,
51 0,
52 0);
53 if (bRet != 0 && bRet != -1)
54 {
55 TranslateMessage(&Msg);
56 DispatchMessage(&Msg);
57 }
58 else if (bRet == 0)
59 break;
60 }
61 }
62
63 UnregisterMMCWndClasses();
64 return 0;
65 }