KillTimer function

Destroys the specified timer.

Syntax

BOOL KillTimer(
  HWND     hWnd,
  UINT_PTR uIDEvent
);

Parameters

hWnd

Type: HWND

A 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

Type: UINT_PTR

The timer to be destroyed. If the window handle passed to SetTimer is valid, this parameter must be the same as the nIDEvent

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 Value

Type: Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

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

Examples

For an example, see Destroying a Timer.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

Reference

SetTimer

Timers

WM_TIMER