From a13500d541764bba3aedd31bf4793774bad2a7bd 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/branches/WX_2_4_BRANCH@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 69d99fc516..a4c05ef5d4 100644 --- a/include/wx/os2/private.h +++ b/include/wx/os2/private.h @@ -263,6 +263,20 @@ WXDLLEXPORT void wxDrawBorder( HPS hPS ,WXDWORD dwStyle ); +#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 + WXDLLEXPORT void wxSetInstance(HINSTANCE hInst); WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);