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
b6959241
Commit
b6959241
authored
Jul 17, 2008
by
Alexander Nicolaysen Sørnes
Committed by
Alexandre Julliard
Jul 18, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Show error if file open fails.
parent
5aa90f37
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
0 deletions
+25
-0
En.rc
programs/wordpad/En.rc
+2
-0
No.rc
programs/wordpad/No.rc
+2
-0
wordpad.c
programs/wordpad/wordpad.c
+19
-0
wordpad.h
programs/wordpad/wordpad.h
+2
-0
No files found.
programs/wordpad/En.rc
View file @
b6959241
...
...
@@ -236,4 +236,6 @@ BEGIN
STRING_OLE_STORAGE_NOT_SUPPORTED, "OLE storage documents are not supported"
STRING_WRITE_FAILED, "Could not save the file."
STRING_WRITE_ACCESS_DENIED, "You do not have access to save the file."
STRING_OPEN_FAILED, "Could not open the file."
STRING_OPEN_ACCESS_DENIED, "You do not have access to open the file."
END
programs/wordpad/No.rc
View file @
b6959241
...
...
@@ -236,4 +236,6 @@ BEGIN
STRING_OLE_STORAGE_NOT_SUPPORTED, "OLE storage documents are not supported"
STRING_WRITE_FAILED, "Klarte ikke lagre filen."
STRING_WRITE_ACCESS_DENIED, "Du har ikke tilgang til lagre filen."
STRING_OPEN_FAILED, "Klarte ikke pne filen."
STRING_OPEN_ACCESS_DENIED, "Du har ikke tilgang til pne filen."
END
programs/wordpad/wordpad.c
View file @
b6959241
...
...
@@ -698,6 +698,22 @@ static void set_fileformat(WPARAM format)
target_device
(
hMainWnd
,
wordWrap
[
reg_formatindex
(
fileFormat
)]);
}
static
void
ShowOpenError
(
DWORD
Code
)
{
LPWSTR
Message
;
switch
(
Code
)
{
case
ERROR_ACCESS_DENIED
:
Message
=
MAKEINTRESOURCEW
(
STRING_OPEN_ACCESS_DENIED
);
break
;
default:
Message
=
MAKEINTRESOURCEW
(
STRING_OPEN_FAILED
);
}
MessageBoxW
(
hMainWnd
,
Message
,
wszAppTitle
,
MB_ICONEXCLAMATION
|
MB_OK
);
}
static
void
DoOpenFile
(
LPCWSTR
szOpenFileName
)
{
HANDLE
hFile
;
...
...
@@ -709,7 +725,10 @@ static void DoOpenFile(LPCWSTR szOpenFileName)
hFile
=
CreateFileW
(
szOpenFileName
,
GENERIC_READ
,
FILE_SHARE_READ
,
NULL
,
OPEN_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
if
(
hFile
==
INVALID_HANDLE_VALUE
)
{
ShowOpenError
(
GetLastError
());
return
;
}
ReadFile
(
hFile
,
fileStart
,
5
,
&
readOut
,
NULL
);
SetFilePointer
(
hFile
,
0
,
NULL
,
FILE_BEGIN
);
...
...
programs/wordpad/wordpad.h
View file @
b6959241
...
...
@@ -195,6 +195,8 @@
#define STRING_OLE_STORAGE_NOT_SUPPORTED 1706
#define STRING_WRITE_FAILED 1707
#define STRING_WRITE_ACCESS_DENIED 1708
#define STRING_OPEN_FAILED 1709
#define STRING_OPEN_ACCESS_DENIED 1710
LPWSTR
file_basename
(
LPWSTR
);
...
...
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