Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e173504c
Commit
e173504c
authored
May 30, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jun 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Split code into set_caption function.
parent
360dee62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
wordpad.c
programs/wordpad/wordpad.c
+21
-15
No files found.
programs/wordpad/wordpad.c
View file @
e173504c
...
@@ -114,7 +114,24 @@ static DWORD CALLBACK stream_in(DWORD_PTR cookie, LPBYTE buffer, LONG cb, LONG *
...
@@ -114,7 +114,24 @@ static DWORD CALLBACK stream_in(DWORD_PTR cookie, LPBYTE buffer, LONG cb, LONG *
return
0
;
return
0
;
}
}
static
void
DoOpenFile
(
LPCWSTR
szFileName
)
static
void
set_caption
(
LPCWSTR
wszNewFileName
)
{
static
const
WCHAR
wszSeparator
[]
=
{
' '
,
'-'
,
' '
,
'\0'
};
WCHAR
wszCaption
[
MAX_PATH
];
if
(
wszNewFileName
)
{
lstrcpyW
(
wszCaption
,
wszNewFileName
);
lstrcatW
(
wszCaption
,
wszSeparator
);
lstrcatW
(
wszCaption
,
wszAppTitle
);
SetWindowTextW
(
hMainWnd
,
wszCaption
);
}
else
{
SetWindowTextW
(
hMainWnd
,
wszAppTitle
);
}
}
static
void
DoOpenFile
(
LPCWSTR
szOpenFileName
)
{
{
HANDLE
hFile
;
HANDLE
hFile
;
LPSTR
pTemp
;
LPSTR
pTemp
;
...
@@ -122,11 +139,7 @@ static void DoOpenFile(LPCWSTR szFileName)
...
@@ -122,11 +139,7 @@ static void DoOpenFile(LPCWSTR szFileName)
DWORD
dwNumRead
;
DWORD
dwNumRead
;
EDITSTREAM
es
;
EDITSTREAM
es
;
char
szCaption
[
MAX_PATH
];
hFile
=
CreateFileW
(
szOpenFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
char
szAppTitle
[
sizeof
(
wszAppTitle
)];
char
szSeparator
[]
=
" - "
;
hFile
=
CreateFileW
(
szFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
if
(
hFile
==
INVALID_HANDLE_VALUE
)
return
;
return
;
...
@@ -166,14 +179,7 @@ static void DoOpenFile(LPCWSTR szFileName)
...
@@ -166,14 +179,7 @@ static void DoOpenFile(LPCWSTR szFileName)
SetFocus
(
hEditorWnd
);
SetFocus
(
hEditorWnd
);
WideCharToMultiByte
(
CP_ACP
,
0
,
wszAppTitle
,
-
1
,
szAppTitle
,
sizeof
(
wszAppTitle
),
NULL
,
NULL
);
set_caption
(
szOpenFileName
);
WideCharToMultiByte
(
CP_ACP
,
0
,
szFileName
,
-
1
,
szCaption
,
MAX_PATH
,
NULL
,
NULL
);
lstrcat
(
szCaption
,
szSeparator
);
lstrcat
(
szCaption
,
szAppTitle
);
SetWindowText
(
hMainWnd
,
szCaption
);
}
}
static
void
DialogOpenFile
(
void
)
static
void
DialogOpenFile
(
void
)
...
@@ -435,7 +441,7 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
...
@@ -435,7 +441,7 @@ static LRESULT OnCommand( HWND hWnd, WPARAM wParam, LPARAM lParam)
case
ID_FILE_NEW
:
case
ID_FILE_NEW
:
SetWindowTextA
(
hwndEditor
,
""
);
SetWindowTextA
(
hwndEditor
,
""
);
SetWindowTextW
(
hMainWnd
,
wszAppTitle
);
set_caption
(
NULL
);
/* FIXME: set default format too */
/* FIXME: set default format too */
break
;
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