Merge aicom-network-branch (without NDIS changes for now)
[reactos.git] / rosapps / applications / devutils / vgafontedit / main.c
1 /*
2 * PROJECT: ReactOS VGA Font Editor
3 * LICENSE: GNU General Public License Version 2.0 or any later version
4 * FILE: devutils/vgafontedit/main.c
5 * PURPOSE: Main entry point of the application
6 * COPYRIGHT: Copyright 2008 Colin Finck <mail@colinfinck.de>
7 */
8
9 #include "precomp.h"
10
11 static const WCHAR szCharacterClipboardFormat[] = L"RosVgaFontChar";
12
13 HINSTANCE hInstance;
14 HANDLE hProcessHeap;
15 PWSTR szAppName;
16 UINT uCharacterClipboardFormat;
17
18 INT WINAPI
19 wWinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
20 {
21 HACCEL hAccel;
22 INT nRet = 1;
23 MSG msg;
24 PMAIN_WND_INFO Info = 0;
25
26 UNREFERENCED_PARAMETER(hPrevInstance);
27 UNREFERENCED_PARAMETER(lpCmdLine);
28
29 hInstance = hInst;
30 hProcessHeap = GetProcessHeap();
31
32 AllocAndLoadString(&szAppName, IDS_APPTITLE);
33
34 hAccel = LoadAcceleratorsW( hInstance, MAKEINTRESOURCEW(IDA_MAINACCELERATORS) );
35
36 uCharacterClipboardFormat = RegisterClipboardFormatW(szCharacterClipboardFormat);
37 if(!uCharacterClipboardFormat)
38 return 1;
39
40 if( InitMainWndClass() && InitFontWndClass() && InitFontBoxesWndClass() && InitEditGlyphWndClasses() )
41 {
42 if( CreateMainWindow(nCmdShow, &Info) )
43 {
44 while( GetMessageW(&msg, NULL, 0, 0) )
45 {
46 if( !TranslateMDISysAccel(Info->hMdiClient, &msg) &&
47 !TranslateAccelerator(Info->hMainWnd, hAccel, &msg) )
48 {
49 TranslateMessage(&msg);
50 DispatchMessage(&msg);
51 }
52 }
53
54 nRet = 0;
55 }
56 }
57
58 HeapFree(hProcessHeap, 0, szAppName);
59
60 // Just unregister our window classes, don't care whether they were created or not
61 UnInitEditGlyphWndClasses();
62 UnInitFontBoxesWndClass();
63 UnInitFontWndClass();
64 UnInitMainWndClass();
65
66 return nRet;
67 }