+ // if there are pending events, we must process them.
+ if (wxTheApp)
+ wxTheApp->ProcessPendingEvents();
+
+ // put back unprocessed events in the queue
+ DWORD id = GetCurrentThreadId();
+ for (size_t i=0; i<m_arrMSG.GetCount(); i++)
+ {
+ PostThreadMessage(id, m_arrMSG[i].message,
+ m_arrMSG[i].wParam, m_arrMSG[i].lParam);
+ }
+
+ m_arrMSG.Clear();
+
+ return true;
+}
+
+
+#else // !wxUSE_GUI
+
+
+// ============================================================================
+// wxConsoleEventLoop implementation
+// ============================================================================
+
+#if wxUSE_CONSOLE_EVENTLOOP
+
+void wxConsoleEventLoop::WakeUp()
+{
+#if wxUSE_THREADS
+ wxWakeUpMainThread();
+#endif
+}
+
+void wxConsoleEventLoop::ProcessMessage(WXMSG *msg)
+{
+ if ( msg->message == WM_TIMER )
+ {
+ TIMERPROC proc = (TIMERPROC)msg->lParam;
+ if ( proc )
+ (*proc)(NULL, 0, msg->wParam, 0);