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
69c9565e
Commit
69c9565e
authored
May 31, 2007
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jun 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Convert open file dialog to Unicode.
parent
a747eca8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
31 deletions
+25
-31
wordpad.c
programs/wordpad/wordpad.c
+25
-31
No files found.
programs/wordpad/wordpad.c
View file @
69c9565e
...
@@ -46,29 +46,29 @@ static const WCHAR wszAppTitle[] = {'W','i','n','e',' ','W','o','r','d','p','a',
...
@@ -46,29 +46,29 @@ static const WCHAR wszAppTitle[] = {'W','i','n','e',' ','W','o','r','d','p','a',
static
HWND
hMainWnd
;
static
HWND
hMainWnd
;
static
HWND
hEditorWnd
;
static
HWND
hEditorWnd
;
static
char
szFilter
[
MAX_STRING_LEN
];
static
WCHAR
w
szFilter
[
MAX_STRING_LEN
];
/* Load string resources */
/* Load string resources */
static
void
DoLoadStrings
(
void
)
static
void
DoLoadStrings
(
void
)
{
{
LP
STR
p
=
szFilter
;
LP
WSTR
p
=
w
szFilter
;
char
files_rtf
[]
=
"*.rtf"
;
static
const
WCHAR
files_rtf
[]
=
{
'*'
,
'.'
,
'r'
,
't'
,
'f'
,
'\0'
}
;
char
files_txt
[]
=
"*.txt"
;
static
const
WCHAR
files_txt
[]
=
{
'*'
,
'.'
,
't'
,
'x'
,
't'
,
'\0'
}
;
char
files_all
[]
=
"*.*"
;
static
const
WCHAR
files_all
[]
=
{
'*'
,
'.'
,
'*'
,
'\0'
}
;
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtr
(
hMainWnd
,
GWLP_HINSTANCE
);
HINSTANCE
hInstance
=
(
HINSTANCE
)
GetWindowLongPtr
(
hMainWnd
,
GWLP_HINSTANCE
);
LoadString
(
hInstance
,
STRING_RICHTEXT_FILES_RTF
,
p
,
MAX_STRING_LEN
);
LoadString
W
(
hInstance
,
STRING_RICHTEXT_FILES_RTF
,
p
,
MAX_STRING_LEN
);
p
+=
strlen
(
p
)
+
1
;
p
+=
lstrlenW
(
p
)
+
1
;
lstrcpy
(
p
,
files_rtf
);
lstrcpy
W
(
p
,
files_rtf
);
p
+=
strlen
(
p
)
+
1
;
p
+=
lstrlenW
(
p
)
+
1
;
LoadString
(
hInstance
,
STRING_TEXT_FILES_TXT
,
p
,
MAX_STRING_LEN
);
LoadString
W
(
hInstance
,
STRING_TEXT_FILES_TXT
,
p
,
MAX_STRING_LEN
);
p
+=
strlen
(
p
)
+
1
;
p
+=
lstrlenW
(
p
)
+
1
;
lstrcpy
(
p
,
files_txt
);
lstrcpy
W
(
p
,
files_txt
);
p
+=
strlen
(
p
)
+
1
;
p
+=
lstrlenW
(
p
)
+
1
;
LoadString
(
hInstance
,
STRING_ALL_FILES
,
p
,
MAX_STRING_LEN
);
LoadString
W
(
hInstance
,
STRING_ALL_FILES
,
p
,
MAX_STRING_LEN
);
p
+=
strlen
(
p
)
+
1
;
p
+=
lstrlenW
(
p
)
+
1
;
lstrcpy
(
p
,
files_all
);
lstrcpy
W
(
p
,
files_all
);
p
+=
strlen
(
p
)
+
1
;
p
+=
lstrlenW
(
p
)
+
1
;
*
p
=
'\0'
;
*
p
=
'\0'
;
}
}
...
@@ -175,29 +175,23 @@ static void DoOpenFile(LPCWSTR szOpenFileName)
...
@@ -175,29 +175,23 @@ static void DoOpenFile(LPCWSTR szOpenFileName)
static
void
DialogOpenFile
(
void
)
static
void
DialogOpenFile
(
void
)
{
{
OPENFILENAME
ofn
;
OPENFILENAME
W
ofn
;
char
szFile
[
MAX_PATH
]
=
""
;
WCHAR
wszFile
[
MAX_PATH
]
=
{
'\0'
}
;
char
szDefExt
[]
=
"rtf"
;
static
const
WCHAR
wszDefExt
[]
=
{
'r'
,
't'
,
'f'
,
'\0'
}
;
ZeroMemory
(
&
ofn
,
sizeof
(
ofn
));
ZeroMemory
(
&
ofn
,
sizeof
(
ofn
));
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
lStructSize
=
sizeof
(
ofn
);
ofn
.
Flags
=
OFN_HIDEREADONLY
|
OFN_FILEMUSTEXIST
|
OFN_PATHMUSTEXIST
;
ofn
.
Flags
=
OFN_HIDEREADONLY
|
OFN_FILEMUSTEXIST
|
OFN_PATHMUSTEXIST
;
ofn
.
hwndOwner
=
hMainWnd
;
ofn
.
hwndOwner
=
hMainWnd
;
ofn
.
lpstrFilter
=
szFilter
;
ofn
.
lpstrFilter
=
w
szFilter
;
ofn
.
lpstrFile
=
szFile
;
ofn
.
lpstrFile
=
w
szFile
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
nMaxFile
=
MAX_PATH
;
ofn
.
lpstrDefExt
=
szDefExt
;
ofn
.
lpstrDefExt
=
w
szDefExt
;
if
(
GetOpenFileName
(
&
ofn
))
if
(
GetOpenFileNameW
(
&
ofn
))
{
DoOpenFile
(
ofn
.
lpstrFile
);
WCHAR
szOpenFile
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
ofn
.
lpstrFile
,
MAX_PATH
,
szOpenFile
,
sizeof
(
szOpenFile
)
/
sizeof
(
szOpenFile
[
0
]));
DoOpenFile
(
szOpenFile
);
}
}
}
static
void
DoSaveFile
(
LPCWSTR
wszSaveFileName
)
static
void
DoSaveFile
(
LPCWSTR
wszSaveFileName
)
...
...
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