I write a non-MFC Win32 application and try to use Timer to redraw some controls. But
callback function TimerProc is not called. I have often used timers before and all have
worked fine.
I start timer with the code
UINT g_Timer = 0; //global
void CALLBACK TimerProc(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD
dwTime)
{
....
}
void Dlg_OnCommand()
{
...
UINT TimerID = 1005; //local
while((g_Timer = SetTimer(g_hDlg, TimerID, 1000, (TIMERPROC)MyTimerProc )) ==
0)
TimerID++;
...
}
After this call g_Timer is the same as TimerID (1005, and it is right, i think). g_hDlg is
a valid window (Dialog in Dialog - based application, and I start the timer with a button
- g_hDlg is visible, another features are started fine with this button).
{
...
if(g_Timer)
KillTimer(g_hDlg, g_Timer);
...
}
works too, only MyTimerProc() is not called (in Debug and Release)...
Does anybody know a solution?