|
1 // MyMessages.cpp |
|
2 |
|
3 #include "StdAfx.h" |
|
4 |
|
5 #include "MyMessages.h" |
|
6 #include "Common/String.h" |
|
7 #include "Common/StringConvert.h" |
|
8 |
|
9 #include "Windows/Error.h" |
|
10 #include "Windows/ResourceString.h" |
|
11 |
|
12 #ifdef LANG |
|
13 #include "../../FileManager/LangUtils.h" |
|
14 #endif |
|
15 |
|
16 using namespace NWindows; |
|
17 |
|
18 void MyMessageBox(HWND window, LPCWSTR message) |
|
19 { |
|
20 ::MessageBoxW(window, message, L"7-Zip", 0); |
|
21 } |
|
22 |
|
23 void MyMessageBox(UINT32 id |
|
24 #ifdef LANG |
|
25 ,UINT32 langID |
|
26 #endif |
|
27 ) |
|
28 { |
|
29 #ifdef LANG |
|
30 MyMessageBox(LangString(id, langID)); |
|
31 #else |
|
32 MyMessageBox(MyLoadStringW(id)); |
|
33 #endif |
|
34 } |
|
35 |
|
36 void ShowErrorMessage(HWND window, DWORD message) |
|
37 { |
|
38 MyMessageBox(window, NError::MyFormatMessageW(message)); |
|
39 } |
|
40 |
|
41 void ShowLastErrorMessage(HWND window) |
|
42 { |
|
43 ShowErrorMessage(window, ::GetLastError()); |
|
44 } |
|
45 |