notepad: Fix trying to open non-existent files with the command line.

This commit is contained in:
Alexander Scott-Johns 2009-06-30 21:25:02 +01:00 committed by Alexandre Julliard
parent f57c603798
commit 42729bc1c1
3 changed files with 4 additions and 2 deletions

View file

@ -59,7 +59,7 @@ VOID ShowLastError(void)
* Untitled - Notepad if no file is open * Untitled - Notepad if no file is open
* filename - Notepad if a file is given * filename - Notepad if a file is given
*/ */
static void UpdateWindowCaption(void) void UpdateWindowCaption(void)
{ {
WCHAR szCaption[MAX_STRING_LEN]; WCHAR szCaption[MAX_STRING_LEN];
WCHAR szNotepad[MAX_STRING_LEN]; WCHAR szNotepad[MAX_STRING_LEN];

View file

@ -52,6 +52,7 @@ int DIALOG_StringMsgBox(HWND hParent, int formatId, LPCWSTR szString, DWORD dwFl
/* utility functions */ /* utility functions */
VOID ShowLastError(void); VOID ShowLastError(void);
void UpdateWindowCaption(void);
BOOL FileExists(LPCWSTR szFilename); BOOL FileExists(LPCWSTR szFilename);
BOOL DoCloseFile(void); BOOL DoCloseFile(void);
void DoOpenFile(LPCWSTR szFileName); void DoOpenFile(LPCWSTR szFileName);

View file

@ -698,7 +698,8 @@ static void HandleCommandLine(LPWSTR cmdline)
{ {
switch (AlertFileDoesNotExist(file_name)) { switch (AlertFileDoesNotExist(file_name)) {
case IDYES: case IDYES:
DoOpenFile(file_name); SetFileName(file_name);
UpdateWindowCaption();
break; break;
case IDNO: case IDNO: