Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c275fd73
Commit
c275fd73
authored
Mar 18, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Mar 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
view: Show the filename in the window title.
parent
a8e2b240
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
view.c
programs/view/view.c
+28
-1
No files found.
programs/view/view.c
View file @
c275fd73
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment