mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 06:46:43 +00:00
(svn r8239) -Regression (r7278): Help window was empty for UNICODE builds
This commit is contained in:
parent
147ca22060
commit
d3a58ba36b
@ -371,7 +371,7 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd,UINT msg,WPARAM wParam,LPARAM l
|
|||||||
case WM_INITDIALOG: {
|
case WM_INITDIALOG: {
|
||||||
#if defined(UNICODE)
|
#if defined(UNICODE)
|
||||||
/* We need to put the crash-log in a seperate buffer because the default
|
/* We need to put the crash-log in a seperate buffer because the default
|
||||||
* buffer in MB_TO_WIDE is not large enough (256 chars) */
|
* buffer in MB_TO_WIDE is not large enough (512 chars) */
|
||||||
wchar_t crash_msgW[8096];
|
wchar_t crash_msgW[8096];
|
||||||
#endif
|
#endif
|
||||||
SetDlgItemText(wnd, 10, _crash_desc);
|
SetDlgItemText(wnd, 10, _crash_desc);
|
||||||
@ -841,12 +841,16 @@ void ShowInfo(const char *str)
|
|||||||
fprintf(stderr, "%s\n", str);
|
fprintf(stderr, "%s\n", str);
|
||||||
} else {
|
} else {
|
||||||
bool old;
|
bool old;
|
||||||
|
#if defined(UNICODE)
|
||||||
|
/* We need to put the text in a seperate buffer because the default
|
||||||
|
* buffer in MB_TO_WIDE might not be large enough (512 chars) */
|
||||||
|
wchar_t help_msgW[4096];
|
||||||
|
#endif
|
||||||
ReleaseCapture();
|
ReleaseCapture();
|
||||||
_left_button_clicked =_left_button_down = false;
|
_left_button_clicked =_left_button_down = false;
|
||||||
|
|
||||||
old = MyShowCursor(true);
|
old = MyShowCursor(true);
|
||||||
if (MessageBox(GetActiveWindow(), MB_TO_WIDE(str), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
|
if (MessageBox(GetActiveWindow(), MB_TO_WIDE_BUFFER(str, help_msgW, lengthof(help_msgW)), _T("OpenTTD"), MB_ICONINFORMATION | MB_OKCANCEL) == IDCANCEL) {
|
||||||
CreateConsole();
|
CreateConsole();
|
||||||
}
|
}
|
||||||
MyShowCursor(old);
|
MyShowCursor(old);
|
||||||
|
Loading…
Reference in New Issue
Block a user