Index: base/applications/notepad/main.c =================================================================== --- base/applications/notepad/main.c (revision 60676) +++ base/applications/notepad/main.c (working copy) @@ -462,9 +462,9 @@ return(nResult); } -static void HandleCommandLine(LPTSTR cmdline) +static BOOL HandleCommandLine(LPTSTR cmdline) { - int opt_print=0; + int opt_print = 0; while (*cmdline == _T(' ') || *cmdline == _T('-') || *cmdline == _T('/')) { @@ -480,7 +480,7 @@ { case 'p': case 'P': - opt_print=1; + opt_print = 1; break; } } @@ -526,7 +526,10 @@ DoOpenFile(file_name); InvalidateRect(Globals.hMainWnd, NULL, FALSE); if (opt_print) + { DIALOG_FilePrint(); + return FALSE; + } } else { @@ -539,7 +542,9 @@ break; } } - } + } + + return TRUE; } /*********************************************************************** @@ -554,10 +559,10 @@ HMONITOR monitor; MONITORINFO info; INT x, y; - + static const TCHAR className[] = _T("NPClass"); static const TCHAR winName[] = _T("Notepad"); - + switch (GetUserDefaultUILanguage()) { case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): @@ -626,7 +631,10 @@ DIALOG_ViewStatusBar(); - HandleCommandLine(cmdline); + if(!HandleCommandLine(cmdline)) + { + return 0; + } hAccel = LoadAccelerators( hInstance, MAKEINTRESOURCE(ID_ACCEL) );