+private:
+ // the HWND of the hidden window
+ static HWND ms_hwnd;
+
+ // the class used to create it
+ static const wxChar *ms_className;
+
+ DECLARE_DYNAMIC_CLASS(wxTimerHiddenWindowModule)
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxTimerHiddenWindowModule, wxModule)
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+
+// ----------------------------------------------------------------------------
+// wxMSWTimerImpl class
+// ----------------------------------------------------------------------------
+
+bool wxMSWTimerImpl::Start(int milliseconds, bool oneShot)
+{
+ if ( !wxTimerImpl::Start(milliseconds, oneShot) )
+ return false;
+
+ m_id = GetNewTimerId(this);
+ // SetTimer() normally returns just idTimer but this might change in the
+ // future so use its return value to be safe
+ UINT_PTR ret = ::SetTimer
+ (
+ wxTimerHiddenWindowModule::GetHWND(), // window for WM_TIMER
+ m_id, // timer ID to create
+ (UINT)m_milli, // delay
+ NULL // timer proc (unused)
+ );
+
+ if ( ret == 0 )
+ {
+ wxLogSysError(_("Couldn't create a timer"));
+
+ return false;
+ }
+
+ return true;
+}
+
+void wxMSWTimerImpl::Stop()
+{
+ ::KillTimer(wxTimerHiddenWindowModule::GetHWND(), m_id);
+ TimerMap().erase(m_id);
+ m_id = 0;
+}
+
+// ----------------------------------------------------------------------------
+// private functions
+// ----------------------------------------------------------------------------
+
+void wxProcessTimer(wxMSWTimerImpl& timer)