Share via


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.

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.

If the uElapse parameter of the SetTimer function is set to INFINITE, KillTimer fails to destroy the timer.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later Winbase.h    

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

GetLastError, SetTimer, WM_TIMER

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.