mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:26:17 +00:00
[FONTVIEW] Add /d option
This commit is contained in:
parent
5d54b65ceb
commit
8ea04e276d
1 changed files with 31 additions and 18 deletions
|
@ -38,6 +38,7 @@ LOGFONTW g_LogFonts[64];
|
||||||
LPCWSTR g_fileName;
|
LPCWSTR g_fileName;
|
||||||
WCHAR g_FontTitle[1024] = L"";
|
WCHAR g_FontTitle[1024] = L"";
|
||||||
BOOL g_FontPrint = FALSE;
|
BOOL g_FontPrint = FALSE;
|
||||||
|
BOOL g_DisableInstall = FALSE;
|
||||||
|
|
||||||
static const WCHAR g_szFontViewClassName[] = L"FontViewWClass";
|
static const WCHAR g_szFontViewClassName[] = L"FontViewWClass";
|
||||||
|
|
||||||
|
@ -157,22 +158,33 @@ wWinMain(HINSTANCE hThisInstance,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Try to add the font resource from command line */
|
/* Try to add the font resource from command line */
|
||||||
// fileName = argv[1];
|
for (i = 1; i < argc; ++i)
|
||||||
if (argc == 2)
|
|
||||||
{
|
{
|
||||||
fileName = argv[1];
|
// Treat the last argument as filename
|
||||||
|
if (i + 1 == argc)
|
||||||
|
{
|
||||||
|
fileName = argv[i];
|
||||||
}
|
}
|
||||||
else
|
else if (argv[i][0] == '/' || argv[i][0] == '-')
|
||||||
{
|
{
|
||||||
/* Windows fontview supports the /p option, which displays print dialog */
|
switch (argv[i][1])
|
||||||
fileName = argv[2];
|
|
||||||
if (wcscmp(argv[1], L"/p") == 0)
|
|
||||||
{
|
{
|
||||||
|
case 'p':
|
||||||
|
case 'P':
|
||||||
g_FontPrint = TRUE;
|
g_FontPrint = TRUE;
|
||||||
|
break;
|
||||||
|
case 'd':
|
||||||
|
case 'D':
|
||||||
|
g_DisableInstall = TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fileName = argv[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileName = argv[1];
|
fileName = argv[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_fileName = fileName;
|
g_fileName = fileName;
|
||||||
|
@ -315,6 +327,7 @@ MainWnd_OnCreate(HWND hwnd)
|
||||||
NULL /* Window Creation data */
|
NULL /* Window Creation data */
|
||||||
);
|
);
|
||||||
SendMessage(hButtonInstall, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), (LPARAM)TRUE);
|
SendMessage(hButtonInstall, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), (LPARAM)TRUE);
|
||||||
|
EnableWindow(hButtonInstall, !g_DisableInstall);
|
||||||
|
|
||||||
/* Create the print button */
|
/* Create the print button */
|
||||||
LoadStringW(g_hInstance, IDS_PRINT, szPrint, MAX_BUTTONNAME);
|
LoadStringW(g_hInstance, IDS_PRINT, szPrint, MAX_BUTTONNAME);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue