]> git.saurik.com Git - wxWidgets.git/commitdiff
Insure that messages are posted to the main threads event loop,
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 7 Sep 2003 17:50:12 +0000 (17:50 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 7 Sep 2003 17:50:12 +0000 (17:50 +0000)
        instead of sending them to the thread-local event loop
        (which typically does not exist under wxWindows).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23421 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/os2/private.h

index 3f8256b982b4d5c049389f41053b70ba02271bf3..74c0a023d61a032ce4b1ab3855e67899a1cef203 100644 (file)
@@ -268,6 +268,20 @@ WXDLLEXPORT HINSTANCE wxGetInstance();
 
 WXDLLEXPORT void wxSetInstance(HINSTANCE hInst);
 
+#include "wx/thread.h"
+static inline MRESULT MySendMsg(HWND hwnd, ULONG ulMsgid,
+                                MPARAM mpParam1, MPARAM mpParam2)
+{
+    MRESULT vRes;
+    vRes = ::WinSendMsg(hwnd, ulMsgid, mpParam1, mpParam2);
+#if wxUSE_THREADS
+    if (!wxThread::IsMain())
+        ::WinPostMsg(hwnd, ulMsgid, mpParam1, mpParam2);
+#endif
+    return vRes;
+}
+#define WinSendMsg MySendMsg
+
 #if wxUSE_GUI
 
 WXDLLEXPORT void wxDrawBorder( HPS     hPS