summaryrefslogtreecommitdiff
path: root/os2.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-12-28 12:11:34 +0000
committertruelight <truelight@openttd.org>2004-12-28 12:11:34 +0000
commit5b8c604f47d4f8a121d9d87ea586e54ecf23ec41 (patch)
treecaf0f9d78a690c84a2ed0b13b4fc560adfcf87f0 /os2.c
parentc2ee8d70e48a79a1f3fbe4003c82a545a29ae195 (diff)
downloadopenttd-5b8c604f47d4f8a121d9d87ea586e54ecf23ec41.tar.xz
(svn r1289) -Fix: Minor fix for OS/2 message boxes (orudge)
Diffstat (limited to 'os2.c')
-rw-r--r--os2.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/os2.c b/os2.c
index c43ba71ad..6de5e01bc 100644
--- a/os2.c
+++ b/os2.c
@@ -11,8 +11,8 @@
#include <dos.h>
#define INCL_DOS
-#define INCL_WINDIALOGS
#define INCL_OS2MM
+#define INCL_WIN
#include <os2.h>
#include <os2me.h>
@@ -481,15 +481,38 @@ static void ChangeWorkingDirectory(char *exe)
}
}
-// for some reason these calls don't actually work properly :/
void ShowInfo(const char *str)
{
- WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, str, "OpenTTD", 0, MB_OK | MB_SYSTEMMODAL | MB_MOVEABLE | MB_INFORMATION);
+ HAB hab;
+ HMQ hmq;
+ ULONG rc;
+
+ // init PM env.
+ hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
+
+ // display the box
+ rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, str, "OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_INFORMATION);
+
+ // terminate PM env.
+ WinDestroyMsgQueue(hmq);
+ WinTerminate(hab);
}
void ShowOSErrorBox(const char *buf)
{
- WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, buf, "OpenTTD", 0, MB_OK | MB_SYSTEMMODAL | MB_MOVEABLE | MB_ERROR);
+ HAB hab;
+ HMQ hmq;
+ ULONG rc;
+
+ // init PM env.
+ hmq = WinCreateMsgQueue((hab = WinInitialize(0)), 0);
+
+ // display the box
+ rc = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, buf, "OpenTTD", 0, MB_OK | MB_MOVEABLE | MB_ERROR);
+
+ // terminate PM env.
+ WinDestroyMsgQueue(hmq);
+ WinTerminate(hab);
}
int CDECL main(int argc, char* argv[])
@@ -588,7 +611,6 @@ void OS2_SwitchToConsoleMode()
pib->pib_ultype = 3;
}
-
/**********************
* OS/2 MIDI PLAYER
**********************/