Minor bug fixes.

This commit is contained in:
Dmitry Timoshkov 2002-11-15 04:13:46 +00:00 committed by Alexandre Julliard
parent 4cda16e03b
commit a1c46d375c

View file

@ -41,6 +41,7 @@ NOTEPAD_GLOBALS Globals;
VOID SetFileName(LPSTR szFileName) VOID SetFileName(LPSTR szFileName)
{ {
lstrcpy(Globals.szFileName, szFileName); lstrcpy(Globals.szFileName, szFileName);
Globals.szFileTitle[0] = 0;
GetFileTitle(szFileName, Globals.szFileTitle, sizeof(Globals.szFileTitle)); GetFileTitle(szFileName, Globals.szFileTitle, sizeof(Globals.szFileTitle));
} }
@ -125,8 +126,6 @@ LRESULT WINAPI NOTEPAD_WndProc(HWND hWnd, UINT msg, WPARAM wParam,
ES_AUTOVSCROLL | ES_MULTILINE, ES_AUTOVSCROLL | ES_MULTILINE,
0, 0, rc.right, rc.bottom, hWnd, 0, 0, rc.right, rc.bottom, hWnd,
NULL, Globals.hInstance, NULL); NULL, Globals.hInstance, NULL);
NOTEPAD_InitData();
DIALOG_FileNew();
} else { } else {
ShowLastError(); ShowLastError();
return -1; return -1;
@ -305,6 +304,9 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show)
ExitProcess(1); ExitProcess(1);
} }
NOTEPAD_InitData();
DIALOG_FileNew();
ShowWindow(Globals.hMainWnd, show); ShowWindow(Globals.hMainWnd, show);
UpdateWindow(Globals.hMainWnd); UpdateWindow(Globals.hMainWnd);
DragAcceptFiles(Globals.hMainWnd, TRUE); DragAcceptFiles(Globals.hMainWnd, TRUE);