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
* filename - Notepad if a file is given
*/
static void UpdateWindowCaption(void)
void UpdateWindowCaption(void)
{
WCHAR szCaption[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 */
VOID ShowLastError(void);
void UpdateWindowCaption(void);
BOOL FileExists(LPCWSTR szFilename);
BOOL DoCloseFile(void);
void DoOpenFile(LPCWSTR szFileName);

View File

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