Author: ekohl
Date: Thu Mar 16 23:36:08 2017
New Revision: 74183
URL:
http://svn.reactos.org/svn/reactos?rev=74183&view=rev
Log:
[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!
Modified:
trunk/reactos/base/applications/fontview/fontview.c
Modified: trunk/reactos/base/applications/fontview/fontview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/fontview…
==============================================================================
--- trunk/reactos/base/applications/fontview/fontview.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/fontview/fontview.c [iso-8859-1] Thu Mar 16 23:36:08
2017
@@ -37,6 +37,7 @@
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 @@
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 @@
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;
}