2008-02-01 21:40:18 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS VGA Font Editor
|
2017-09-29 13:58:14 +00:00
|
|
|
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
|
2008-02-01 21:40:18 +00:00
|
|
|
* PURPOSE: Main entry point of the application
|
2017-09-29 13:58:14 +00:00
|
|
|
* COPYRIGHT: Copyright 2008 Colin Finck (colin@reactos.org)
|
2008-02-01 21:40:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "precomp.h"
|
|
|
|
|
2008-02-25 18:01:06 +00:00
|
|
|
static const WCHAR szCharacterClipboardFormat[] = L"RosVgaFontChar";
|
|
|
|
|
2008-02-01 21:40:18 +00:00
|
|
|
HINSTANCE hInstance;
|
|
|
|
HANDLE hProcessHeap;
|
2008-02-05 15:12:35 +00:00
|
|
|
PWSTR szAppName;
|
2008-02-25 18:01:06 +00:00
|
|
|
UINT uCharacterClipboardFormat;
|
2008-02-01 21:40:18 +00:00
|
|
|
|
|
|
|
INT WINAPI
|
|
|
|
wWinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
|
|
|
|
{
|
|
|
|
HACCEL hAccel;
|
|
|
|
INT nRet = 1;
|
|
|
|
MSG msg;
|
|
|
|
PMAIN_WND_INFO Info = 0;
|
|
|
|
|
|
|
|
UNREFERENCED_PARAMETER(hPrevInstance);
|
|
|
|
UNREFERENCED_PARAMETER(lpCmdLine);
|
|
|
|
|
|
|
|
hInstance = hInst;
|
|
|
|
hProcessHeap = GetProcessHeap();
|
|
|
|
|
2008-02-05 15:12:35 +00:00
|
|
|
AllocAndLoadString(&szAppName, IDS_APPTITLE);
|
|
|
|
|
2008-02-01 21:40:18 +00:00
|
|
|
hAccel = LoadAcceleratorsW( hInstance, MAKEINTRESOURCEW(IDA_MAINACCELERATORS) );
|
|
|
|
|
2008-02-25 18:01:06 +00:00
|
|
|
uCharacterClipboardFormat = RegisterClipboardFormatW(szCharacterClipboardFormat);
|
|
|
|
if(!uCharacterClipboardFormat)
|
|
|
|
return 1;
|
|
|
|
|
2008-02-01 21:40:18 +00:00
|
|
|
if( InitMainWndClass() && InitFontWndClass() && InitFontBoxesWndClass() && InitEditGlyphWndClasses() )
|
|
|
|
{
|
|
|
|
if( CreateMainWindow(nCmdShow, &Info) )
|
|
|
|
{
|
|
|
|
while( GetMessageW(&msg, NULL, 0, 0) )
|
|
|
|
{
|
|
|
|
if( !TranslateMDISysAccel(Info->hMdiClient, &msg) &&
|
|
|
|
!TranslateAccelerator(Info->hMainWnd, hAccel, &msg) )
|
|
|
|
{
|
|
|
|
TranslateMessage(&msg);
|
|
|
|
DispatchMessage(&msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nRet = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-02-05 15:12:35 +00:00
|
|
|
HeapFree(hProcessHeap, 0, szAppName);
|
|
|
|
|
2008-02-01 21:40:18 +00:00
|
|
|
// Just unregister our window classes, don't care whether they were created or not
|
|
|
|
UnInitEditGlyphWndClasses();
|
|
|
|
UnInitFontBoxesWndClass();
|
|
|
|
UnInitFontWndClass();
|
|
|
|
UnInitMainWndClass();
|
|
|
|
|
|
|
|
return nRet;
|
|
|
|
}
|