Microsoft Foundation Classes (mfc.hlp) (
Table of Contents;
Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
CWnd::SetTimer
◄CWnd► ◄Up► ◄Contents► ◄Index► ◄Back►
──Microsoft Foundation Classes──────────────────────────────────────────────
UINT SetTimer( int nIDEvent, UINT nElapse,
UINT (FAR PASCAL EXPORT* lpfnTimer)(HWND, UINT, int,
DWORD) );
Parameter Description
<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 handled by
the CWnd.
Remarks
Installs a system timer. A time-out value is specified, and every time a
time-out occurs, the system posts a ◄WM_TIMER► message to the installing
application's message queue or passes the message to an
application-supplied TimerProc callback function.
Timers are a limited global resource; therefore, it is important that an
application check the value returned by the SetTimer member function to
verify that a timer is actually available.
The <lpfnTimer> callback function need not be named TimerProc, but it
must be defined as follows, and return 0.
UINT FAR PASCAL EXPORT TimerProc(
HWND hWnd, //handle of CWnd that called SetTimer
UINT nMsg, //WM_TIMER
int nIDEvent //timer identification
DWORD dwTime //system time
);
Return Value
The timer identifier to use in KillTimer if the function is successful;
otherwise 0.
See Also
◄WM_TIMER►, ◄CWnd::KillTimer►, ◄::SetTimer►, ◄CWnd::FromHandle►
-♦-