mirror of
https://github.com/reactos/reactos.git
synced 2025-04-21 12:40:33 +00:00
[FONTVIEW]
Implement fontview /p parameter support. Patch by amber. Patch was slightly modified by me in order to open the print dialog automatically. CORE-12944 #resolve #comment Thanks a lot! svn path=/trunk/; revision=74183
This commit is contained in:
parent
c3297be6ce
commit
e17745ee73
1 changed files with 22 additions and 1 deletions
|
@ -37,6 +37,7 @@ INT g_NumFonts = 0;
|
|||
LOGFONTW g_LogFonts[64];
|
||||
LPCWSTR g_fileName;
|
||||
WCHAR g_FontTitle[1024] = L"";
|
||||
BOOL g_FontPrint = FALSE;
|
||||
|
||||
static const WCHAR g_szFontViewClassName[] = L"FontViewWClass";
|
||||
|
||||
|
@ -156,7 +157,24 @@ wWinMain(HINSTANCE hThisInstance,
|
|||
else
|
||||
{
|
||||
/* Try to add the font resource from command line */
|
||||
fileName = argv[1];
|
||||
// fileName = argv[1];
|
||||
if (argc == 2)
|
||||
{
|
||||
fileName = argv[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Windows fontview supports the /p option, which displays print dialog */
|
||||
fileName = argv[2];
|
||||
if (wcscmp(argv[1], L"/p") == 0)
|
||||
{
|
||||
g_FontPrint = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fileName = argv[1];
|
||||
}
|
||||
}
|
||||
g_fileName = fileName;
|
||||
}
|
||||
|
||||
|
@ -361,6 +379,9 @@ MainWnd_OnCreate(HWND hwnd)
|
|||
SendMessage(hDisplay, FVM_SETTYPEFACE, 0, (LPARAM)&g_LogFonts[g_FontIndex]);
|
||||
ShowWindow(hDisplay, SW_SHOWNORMAL);
|
||||
|
||||
if (g_FontPrint)
|
||||
PostMessage(hwnd, WM_COMMAND, IDC_PRINT, 0);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue