SetTimer()函数用法
UINT SetTimer( UINT nIDEvent, UINT nElapse, void (CALLBACK EXPORT* lpfnTimer)(HWND, UINT, UINT, DWORD) );
Return Value
The timer identifier of the new timer if the function is successful. An application passes this value to the KillTimer member function to kill the timer. Nonzero if successful; otherwise 0.
如果函数成功,则返回新定时器的标识符。应用程序可以将这个值传递给KillTimer成员函数以销毁定时器。如果成功,则返回非零值;否则返回0。
Parameters
nIDEvent
Specifies a nonzero timer identifier.
指定了不为零的定时器标识符。
nElapse
Specifies the time-out value, in milliseconds.
指定了定时值;以毫秒为单位。
lpfnTimer
Specifies the address of the application-supplied TimerProc callback function that processes the WM_TIMER messages. If this parameter is NULL, the WM_TIMER messages are placed in the application’s message queue and handled by the CWnd object.
指定了应用程序提供的TimerProc回调函数的地址,该函数被用于处理WM_TIMER消息。如果这个参数为NULL,则WM_TIMER消息被放入应用程序的消息队列并由CWnd对象来处理。
KillTimer()用法
BOOL KillTimer( int nIDEvent );
Return Value
Specifies the outcome of the function. The value is nonzero if the event was killed. It is 0 if the KillTimer member function could not find the specified timer event.
指定了函数的结果。如果事件已经被销毁,则返回值为非零值。如果KillTimer成员函数不能找到指定的定时器事件,则返回0。
Parameters
nIDEvent
The value of the timer event passed to SetTimer.
传递给SetTimer的定时器事件值。