Alexander Nicolaysen Sørnes : wordpad: Store file name globally.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 4 08:14:26 CDT 2007


Module: wine
Branch: master
Commit: d072e8b1a9f70aaec4c2790718725da3c692acee
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d072e8b1a9f70aaec4c2790718725da3c692acee

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Wed May 30 14:56:20 2007 +0200

wordpad: Store file name globally.

---

 programs/wordpad/wordpad.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index e131527..524d2d2 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -114,6 +114,8 @@ static DWORD CALLBACK stream_in(DWORD_PTR cookie, LPBYTE buffer, LONG cb, LONG *
     return 0;
 }
 
+static WCHAR wszFileName[MAX_PATH];
+
 static void set_caption(LPCWSTR wszNewFileName)
 {
     static const WCHAR wszSeparator[] = {' ','-',' ','\0'};
@@ -180,6 +182,8 @@ static void DoOpenFile(LPCWSTR szOpenFileName)
     SetFocus(hEditorWnd);
 
     set_caption(szOpenFileName);
+
+    lstrcpyW(wszFileName, szOpenFileName);
 }
 
 static void DialogOpenFile(void)
@@ -442,6 +446,7 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
     case ID_FILE_NEW:
         SetWindowTextA(hwndEditor, "");
         set_caption(NULL);
+        wszFileName[0] = '\0';
         /* FIXME: set default format too */
         break;
 




More information about the wine-cvs mailing list