vc++6.0 settimer函数是怎么用的啊,能给个例子在讲解一下行么

来源:百度知道 编辑:UC知道 时间:2024/05/07 20:13:15

CWnd::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消息。如果这个参数为NU