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