1 // MyMessages.cpp 2 3 #include "StdAfx.h" 4 5 #include "MyMessages.h" 6 7 #include "../../../Windows/ErrorMsg.h" 8 #include "../../../Windows/ResourceString.h" 9 10 #include "../FileManager/LangUtils.h" 11 12 using namespace NWindows; 13 14 void ShowErrorMessage(HWND window, LPCWSTR message) 15 { 16 ::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP); 17 } 18 19 void ShowErrorMessageHwndRes(HWND window, UINT resID) 20 { 21 ShowErrorMessage(window, LangString(resID)); 22 } 23 24 void ShowErrorMessageRes(UINT resID) 25 { 26 ShowErrorMessageHwndRes(0, resID); 27 } 28 29 void ShowErrorMessageDWORD(HWND window, DWORD errorCode) 30 { 31 ShowErrorMessage(window, NError::MyFormatMessage(errorCode)); 32 } 33 34 void ShowLastErrorMessage(HWND window) 35 { 36 ShowErrorMessageDWORD(window, ::GetLastError()); 37 } 38