michael@0: // MyMessages.cpp michael@0: michael@0: #include "StdAfx.h" michael@0: michael@0: #include "MyMessages.h" michael@0: #include "Common/String.h" michael@0: #include "Common/StringConvert.h" michael@0: michael@0: #include "Windows/Error.h" michael@0: #include "Windows/ResourceString.h" michael@0: michael@0: #ifdef LANG michael@0: #include "../../FileManager/LangUtils.h" michael@0: #endif michael@0: michael@0: using namespace NWindows; michael@0: michael@0: void MyMessageBox(HWND window, LPCWSTR message) michael@0: { michael@0: ::MessageBoxW(window, message, L"7-Zip", 0); michael@0: } michael@0: michael@0: void MyMessageBox(UINT32 id michael@0: #ifdef LANG michael@0: ,UINT32 langID michael@0: #endif michael@0: ) michael@0: { michael@0: #ifdef LANG michael@0: MyMessageBox(LangString(id, langID)); michael@0: #else michael@0: MyMessageBox(MyLoadStringW(id)); michael@0: #endif michael@0: } michael@0: michael@0: void ShowErrorMessage(HWND window, DWORD message) michael@0: { michael@0: MyMessageBox(window, NError::MyFormatMessageW(message)); michael@0: } michael@0: michael@0: void ShowLastErrorMessage(HWND window) michael@0: { michael@0: ShowErrorMessage(window, ::GetLastError()); michael@0: } michael@0: