X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57bd4c6031d438f11af0ec540136f49a928b923c..2229243bdf17485b33c15786124ab99366b83975:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index d6fc28e390..73c1967327 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -52,6 +52,7 @@ #include "wx/msw/private.h" #include "wx/msw/ole/oleutils.h" +#include "wx/msw/private/timer.h" #if wxUSE_TOOLTIPS #include "wx/tooltip.h" @@ -77,10 +78,7 @@ #include #include -// For MB_TASKMODAL -#ifdef __WXWINCE__ -#include "wx/msw/wince/missing.h" -#endif +#include "wx/msw/missing.h" // instead of including which is not part of the core SDK and not // shipped at all with other compilers, we always define the parts of it we @@ -225,6 +223,26 @@ bool wxGUIAppTraits::DoMessageFromThreadWait() return evtLoop->Dispatch(); } +DWORD wxGUIAppTraits::WaitForThread(WXHANDLE hThread) +{ + // if we don't have a running event loop, we shouldn't wait for the + // messages as we never remove them from the message queue and so we enter + // an infinite loop as MsgWaitForMultipleObjects() keeps returning + // WAIT_OBJECT_0 + 1 + if ( !wxEventLoop::GetActive() ) + return DoSimpleWaitForThread(hThread); + + return ::MsgWaitForMultipleObjects + ( + 1, // number of objects to wait for + (HANDLE *)&hThread, // the objects + false, // wait for any objects, not all + INFINITE, // no timeout + QS_ALLINPUT | // return as soon as there are any events + QS_ALLPOSTMESSAGE + ); +} + wxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const { OSVERSIONINFO info; @@ -248,6 +266,12 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *majVer, int *minVer) const #endif } +wxTimerImpl * +wxGUIAppTraits::CreateTimerImpl(wxTimer *timer) +{ + return new wxMSWTimerImpl(timer); +} + // =========================================================================== // wxApp implementation // =========================================================================== @@ -752,30 +776,3 @@ terminate the program,\r\n\ } #endif // wxUSE_EXCEPTIONS - -// ---------------------------------------------------------------------------- -// deprecated event loop functions -// ---------------------------------------------------------------------------- - -#if WXWIN_COMPATIBILITY_2_4 - -void wxApp::DoMessage(WXMSG *pMsg) -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - if ( evtLoop ) - evtLoop->ProcessMessage(pMsg); -} - -bool wxApp::DoMessage() -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - return evtLoop ? evtLoop->Dispatch() : false; -} - -bool wxApp::ProcessMessage(WXMSG* pMsg) -{ - wxEventLoop *evtLoop = wxEventLoop::GetActive(); - return evtLoop && evtLoop->PreProcessMessage(pMsg); -} - -#endif // WXWIN_COMPATIBILITY_2_4