-
I am having a problem killing a timer I have set
I set the timer with:
Code:
m_TimerID = SetTimer(m_hWnd,1,5000,(TIMERPROC)TimerProc);
And I have tried both of the following to kill the timer
Code:
BOOL ret;
ret = KillTimer(m_hWnd,1);
ret = KillTimer(m_hWnd,m_TimerID);
Neither one seems to kill the timer, and the both return false. Any ideas on what I am doing wrong or how to kill the timer?
Thanks
-
According to MS this should work:
Code:
ret = KillTimer(NULL, m_TimerID);
Where m_TimerID is the Timer ID you received from the SetTimer function
Or
Code:
ret = KillTimer(m_hWnd,1);
Where 1 is the Timer ID (I see you use 1 in the SetTimer too)
-
I figured it out. My window handle was no inited yet so it was 0x00000000 in the SetTimer function and 0x0000da16 in the KillTimer. So I just set the kill and set to the same handle and it works now. Thanks for the help.