Win32: Switch to a UNICODE build. This took quite a bit of fixing.

This commit is contained in:
Henrik Rydgard 2013-08-26 19:00:16 +02:00
parent fdaff2af98
commit 55aa3d13c7
63 changed files with 572 additions and 517 deletions

View file

@ -20,6 +20,7 @@
#include "Common.h" // Local
#include "StringUtils.h"
#include "util/text/utf8.h"
bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style);
static MsgAlertHandler msg_handler = DefaultMsgHandler;
@ -106,15 +107,18 @@ bool MsgAlert(bool yes_no, int Style, const char* format, ...)
bool DefaultMsgHandler(const char* caption, const char* text, bool yes_no, int Style)
{
#ifdef _WIN32
int STYLE = MB_ICONINFORMATION;
if (Style == QUESTION) STYLE = MB_ICONQUESTION;
if (Style == WARNING) STYLE = MB_ICONWARNING;
return IDYES == MessageBox(0, text, caption, STYLE | (yes_no ? MB_YESNO : MB_OK));
int STYLE = MB_ICONINFORMATION;
if (Style == QUESTION) STYLE = MB_ICONQUESTION;
if (Style == WARNING) STYLE = MB_ICONWARNING;
std::wstring wtext = ConvertUTF8ToWString(text);
std::wstring wcaption = ConvertUTF8ToWString(caption);
return IDYES == MessageBox(0, wtext.c_str(), wcaption.c_str(), STYLE | (yes_no ? MB_YESNO : MB_OK));
#else
printf("%s\n", text);
return true;
printf("%s\n", text);
return true;
#endif
}