KillTimer function

Destroys the specified timer.

Syntax


BOOL WINAPI KillTimer(
  _In_opt_  HWND hWnd,
  _In_      UINT_PTR uIDEvent
);

Parameters

hWnd [in, optional]

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 [in]

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]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
SetTimer
WM_TIMER
Conceptual
Timers

 

 

Community Additions

ADD
Show:
© 2014 Microsoft