+
+LRESULT APIENTRY _EXPORT wxTimerWndProc(HWND hWnd, UINT message,
+ WPARAM wParam, LPARAM lParam)
+{
+ if ( message == WM_TIMER )
+ {
+ wxTimerMap::iterator node = TimerMap().find(wParam);
+
+ if ( node != TimerMap().end() )
+ {
+ wxProcessTimer(*(node->second));
+
+ return 0;
+ }
+ //else: Unknown timer, probably one of our timers that had fired just
+ // before being removed from the timers map by Stop().
+ }
+
+ return ::DefWindowProc(hWnd, message, wParam, lParam);
+}
+
+// ----------------------------------------------------------------------------
+// wxTimerHiddenWindowModule functions
+// ----------------------------------------------------------------------------
+
+
+HWND wxTimerHiddenWindowModule::ms_hwnd = NULL;
+
+const wxChar *wxTimerHiddenWindowModule::ms_className = NULL;
+
+bool wxTimerHiddenWindowModule::OnInit()
+{
+ // do not initialize ms_hwnd to ms_className to NULL here: it may happen
+ // that our GetHWND() is called before the modules are initialized if a
+ // timer is created from wxApp-derived class ctor and in this case we
+ // shouldn't overwrite it
+
+ return true;
+}
+
+void wxTimerHiddenWindowModule::OnExit()