mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 10:41:12 +00:00
wordpad: Show error message if saving fails.
This commit is contained in:
parent
e3efa88c45
commit
bd2734d9c6
4 changed files with 25 additions and 0 deletions
|
@ -234,4 +234,6 @@ BEGIN
|
|||
"Are you sure that you wish to do this?"
|
||||
STRING_INVALID_NUMBER, "Invalid number format"
|
||||
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."
|
||||
END
|
||||
|
|
|
@ -234,4 +234,6 @@ BEGIN
|
|||
"sikker på at du vil fortsette?"
|
||||
STRING_INVALID_NUMBER, "Ugyldig tallformat"
|
||||
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."
|
||||
END
|
||||
|
|
|
@ -753,6 +753,22 @@ static void DoOpenFile(LPCWSTR szOpenFileName)
|
|||
update_font_list();
|
||||
}
|
||||
|
||||
static void ShowWriteError(DWORD Code)
|
||||
{
|
||||
LPWSTR Message;
|
||||
|
||||
switch(Code)
|
||||
{
|
||||
case ERROR_ACCESS_DENIED:
|
||||
Message = MAKEINTRESOURCEW(STRING_WRITE_ACCESS_DENIED);
|
||||
break;
|
||||
|
||||
default:
|
||||
Message = MAKEINTRESOURCEW(STRING_WRITE_FAILED);
|
||||
}
|
||||
MessageBoxW(hMainWnd, Message, wszAppTitle, MB_ICONEXCLAMATION | MB_OK);
|
||||
}
|
||||
|
||||
static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
|
||||
{
|
||||
HANDLE hFile;
|
||||
|
@ -763,7 +779,10 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
|
|||
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if(hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
ShowWriteError(GetLastError());
|
||||
return;
|
||||
}
|
||||
|
||||
if(format == (SF_TEXT | SF_UNICODE))
|
||||
{
|
||||
|
|
|
@ -193,6 +193,8 @@
|
|||
#define STRING_SAVE_LOSEFORMATTING 1704
|
||||
#define STRING_INVALID_NUMBER 1705
|
||||
#define STRING_OLE_STORAGE_NOT_SUPPORTED 1706
|
||||
#define STRING_WRITE_FAILED 1707
|
||||
#define STRING_WRITE_ACCESS_DENIED 1708
|
||||
|
||||
LPWSTR file_basename(LPWSTR);
|
||||
|
||||
|
|
Loading…
Reference in a new issue