1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,45 @@ 1.4 +// MyMessages.cpp 1.5 + 1.6 +#include "StdAfx.h" 1.7 + 1.8 +#include "MyMessages.h" 1.9 +#include "Common/String.h" 1.10 +#include "Common/StringConvert.h" 1.11 + 1.12 +#include "Windows/Error.h" 1.13 +#include "Windows/ResourceString.h" 1.14 + 1.15 +#ifdef LANG 1.16 +#include "../../FileManager/LangUtils.h" 1.17 +#endif 1.18 + 1.19 +using namespace NWindows; 1.20 + 1.21 +void MyMessageBox(HWND window, LPCWSTR message) 1.22 +{ 1.23 + ::MessageBoxW(window, message, L"7-Zip", 0); 1.24 +} 1.25 + 1.26 +void MyMessageBox(UINT32 id 1.27 + #ifdef LANG 1.28 + ,UINT32 langID 1.29 + #endif 1.30 + ) 1.31 +{ 1.32 + #ifdef LANG 1.33 + MyMessageBox(LangString(id, langID)); 1.34 + #else 1.35 + MyMessageBox(MyLoadStringW(id)); 1.36 + #endif 1.37 +} 1.38 + 1.39 +void ShowErrorMessage(HWND window, DWORD message) 1.40 +{ 1.41 + MyMessageBox(window, NError::MyFormatMessageW(message)); 1.42 +} 1.43 + 1.44 +void ShowLastErrorMessage(HWND window) 1.45 +{ 1.46 + ShowErrorMessage(window, ::GetLastError()); 1.47 +} 1.48 +