Files

41 lines
814 B
C++
Raw Permalink Normal View History

2021-10-19 21:27:23 +01:00
// MyMessages.cpp
#include "StdAfx.h"
#include "MyMessages.h"
#include "../../../Windows/ErrorMsg.h"
#include "../../../Windows/ResourceString.h"
#include "../FileManager/LangUtils.h"
using namespace NWindows;
void ShowErrorMessage(HWND window, LPCWSTR message)
{
::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP);
}
void ShowErrorMessageHwndRes(HWND window, UINT resID)
{
2023-09-24 03:13:03 +01:00
UString s = LangString(resID);
if (s.IsEmpty())
s.Add_UInt32(resID);
ShowErrorMessage(window, s);
2021-10-19 21:27:23 +01:00
}
void ShowErrorMessageRes(UINT resID)
{
2023-09-24 03:13:03 +01:00
ShowErrorMessageHwndRes(NULL, resID);
2021-10-19 21:27:23 +01:00
}
static void ShowErrorMessageDWORD(HWND window, DWORD errorCode)
{
ShowErrorMessage(window, NError::MyFormatMessage(errorCode));
}
void ShowLastErrorMessage(HWND window)
{
ShowErrorMessageDWORD(window, ::GetLastError());
}