+// ----------------------------------------------------------------------------
+// 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)
+{
+ wxASSERT_MSG( timer.IsRunning(), wxT("bogus timer id") );
+
+ if ( timer.IsOneShot() )
+ timer.Stop();
+
+ timer.Notify();