SetTimer(hwnd, // handle to main window IDT_TIMER3, // timer identifier 5000, // 5-second interval (TIMERPROC) MyTimerProc); // timer callback The calling convention for MyTimerProc must be based on the TimerProc callback function. TimerProc的定义:VOID CALLBACK TimerProc( HWND hwnd, // handle to window UINT uMsg, // WM_TIMER message UINT_PTR idEvent, // timer identifier DWORD dwTime // current system time );具体查看MSDN SetTimer(),一般把TimerProc设置为NULL
但你也可以把这个设置为NULL,
而在WM_TIMER中用Case来处理。
SetTimer(hwnd, // handle to main window
IDT_TIMER3, // timer identifier
5000, // 5-second interval
(TIMERPROC) MyTimerProc); // timer callback
The calling convention for MyTimerProc must be based on the TimerProc callback function. TimerProc的定义:VOID CALLBACK TimerProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_TIMER message
UINT_PTR idEvent, // timer identifier
DWORD dwTime // current system time
);具体查看MSDN SetTimer(),一般把TimerProc设置为NULL