1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00
DxWnd.reloaded/host/MessageBox.cpp
gho tik 52dcf84601 v2_03_91_src_fx5
Former-commit-id: 5354fc59f0281dcfbedf0226d607cc4501799929
2017-03-06 11:47:44 -05:00

37 lines
944 B
C++

#include "stdafx.h"
#include <stdio.h>
#include <stdarg.h>
extern BOOL gQuietMode;
int MessageBoxLang(UINT iText, UINT iCaption, UINT uType)
{
WCHAR sBuffer[1024+1];
WCHAR sCaption[48+1];
if (gQuietMode) return MB_OK;
LoadStringW(AfxGetResourceHandle(), iText, (LPWSTR)&sBuffer, sizeof(sBuffer));
LoadStringW(AfxGetResourceHandle(), iCaption, (LPWSTR)&sCaption, sizeof(sCaption));
return MessageBoxExW(NULL, sBuffer, sCaption, uType, NULL);
}
int MessageBoxLangArg(UINT iText, UINT iCaption, UINT uType, ...)
{
va_list al;
WCHAR sBuffer[1024+1];
WCHAR sFormat[1024+1];
WCHAR sCaption[48+1];
if (gQuietMode) return MB_OK;
LoadStringW(AfxGetResourceHandle(), iText, (LPWSTR)&sFormat, sizeof(sFormat));
LoadStringW(AfxGetResourceHandle(), iCaption, (LPWSTR)&sCaption, sizeof(sCaption));
va_start(al, uType);
vswprintf(sBuffer, 1024, sFormat, al);
va_end(al);
return MessageBoxExW(NULL, sBuffer, sCaption, uType, NULL);
}