2014-06-22 12:39:24 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
|
2016-10-16 12:47:44 -04:00
|
|
|
extern BOOL gQuietMode;
|
|
|
|
|
2014-06-22 12:39:24 -04:00
|
|
|
int MessageBoxLang(UINT iText, UINT iCaption, UINT uType)
|
|
|
|
{
|
|
|
|
WCHAR sBuffer[1024+1];
|
|
|
|
WCHAR sCaption[48+1];
|
2016-10-16 12:47:44 -04:00
|
|
|
|
|
|
|
if (gQuietMode) return MB_OK;
|
2014-06-22 12:39:24 -04:00
|
|
|
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];
|
|
|
|
|
2016-10-16 12:47:44 -04:00
|
|
|
if (gQuietMode) return MB_OK;
|
2014-06-22 12:39:24 -04:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|