From d4ca5c8c7b1c87e5989a3638f665061aef8e2732 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 7 Sep 2003 17:50:12 +0000 Subject: [PATCH] Insure that messages are posted to the main threads event loop, 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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/wx/os2/private.h b/include/wx/os2/private.h index 3f8256b982..74c0a023d6 100644 --- a/include/wx/os2/private.h +++ b/include/wx/os2/private.h @@ -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