KillTimer

This function destroys the specified timer. The system searches the message queue for any pending WM_TIMER messages associated with the timer and removes them.

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

Syntax

BOOL KillTimer(HWND hWnd, UINT uIDEvent);

Parameters

hWnd

Handle to the window associated with the specified timer. This value must be the same as the hWnd value passed to the SetTimer function that created the timer.

uIDEvent

Specifies the identifier of the timer to be destroyed. If the window handle passed to SetTimer is valid, this parameter must be the same as the uIDEvent value passed to SetTimer. If the application calls SetTimer with hWnd set to NULL, this parameter must be the timer identifier returned by SetTimer.

Return Values

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

The KillTimer function does not remove WM_TIMER messages already posted to the message queue.

See Also

SetTimer, WM_TIMER