[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:02:34 UTC 2012
The following commit has been merged in the wheezy branch:
commit fb2324a978b27d97cb6b461c45c2bc51e20efc4f
Author: André Hentschel <nerv at dawncrow.de>
Date: Sun Mar 18 19:31:15 2012 +0100
view: Show the filename in the window title.
(cherry picked from commit c275fd73fd5046f35709ee1f90f1baaff9a0095f)
diff --git a/programs/view/view.c b/programs/view/view.c
index c50a0ff..ebd48aa 100644
--- a/programs/view/view.c
+++ b/programs/view/view.c
@@ -25,7 +25,8 @@
static HINSTANCE hInst;
static HWND hMainWnd;
static WCHAR szAppName[5] = {'V','i','e','w',0};
-static WCHAR szTitle[80];
+static WCHAR szTitle[MAX_PATH];
+static WCHAR szFileTitle[MAX_PATH];
static HMETAFILE hmf;
static HENHMETAFILE enhmf;
@@ -204,6 +205,27 @@ static void DoOpenFile(LPCWSTR filename)
InvalidateRect( hMainWnd, NULL, TRUE );
}
+static void UpdateWindowCaption(void)
+{
+ WCHAR szCaption[MAX_PATH];
+ WCHAR szView[MAX_PATH];
+ static const WCHAR hyphenW[] = { ' ','-',' ',0 };
+
+ LoadStringW(hInst, IDS_DESCRIPTION, szView, sizeof(szView)/sizeof(WCHAR));
+
+ if (szFileTitle[0] != '\0')
+ {
+ lstrcpyW(szCaption, szFileTitle);
+ LoadStringW(hInst, IDS_DESCRIPTION, szView, sizeof(szView)/sizeof(WCHAR));
+ lstrcatW(szCaption, hyphenW);
+ lstrcatW(szCaption, szView);
+ }
+ else
+ lstrcpyW(szCaption, szView);
+
+ SetWindowTextW(hMainWnd, szCaption);
+}
+
static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
{
switch (uMessage)
@@ -236,7 +258,12 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM
{
WCHAR filename[MAX_PATH];
if (FileOpen(hwnd, filename, sizeof(filename)/sizeof(WCHAR)))
+ {
+ szFileTitle[0] = 0;
+ GetFileTitleW(filename, szFileTitle, sizeof(szFileTitle));
DoOpenFile(filename);
+ UpdateWindowCaption();
+ }
}
break;
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list