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 12using namespace NWindows; 13 14void ShowErrorMessage(HWND window, LPCWSTR message) 15{ 16 ::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP); 17} 18 19void ShowErrorMessageHwndRes(HWND window, UINT resID) 20{ 21 UString s = LangString(resID); 22 if (s.IsEmpty()) 23 s.Add_UInt32(resID); 24 ShowErrorMessage(window, s); 25} 26 27void ShowErrorMessageRes(UINT resID) 28{ 29 ShowErrorMessageHwndRes(NULL, resID); 30} 31 32static void ShowErrorMessageDWORD(HWND window, DWORD errorCode) 33{ 34 ShowErrorMessage(window, NError::MyFormatMessage(errorCode)); 35} 36 37void ShowLastErrorMessage(HWND window) 38{ 39 ShowErrorMessageDWORD(window, ::GetLastError()); 40} 41