-#if !defined(QS_ALLPOSTMESSAGE)
-#define QS_ALLPOSTMESSAGE 0
-#endif
-
- result = ::MsgWaitForMultipleObjects
- (
- 1, // number of objects to wait for
- &m_hThread, // the objects
- false, // don't wait for all objects
- INFINITE, // no timeout
- QS_ALLINPUT|QS_ALLPOSTMESSAGE // return as soon as there are any events
- );
+ wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
+ if ( traits )
+ {
+ result = traits->WaitForThread(m_hThread);
+ }
+ else // can't wait for the thread
+ {
+ // so kill it below
+ result = 0xFFFFFFFF;
+ }