windows_programming_notes.nbk: Home | Index | Next Page: win32 notifications | Previous Page: win32 msgs: WM_TIMECHANGE


 win32 msgs: WM_TIMER

The WM_TIMER message is posted to the installing thread's message queue when a timer expires. The message is posted by the GetMessage or PeekMessage function.

A window receives this message through its WindowProc function.

    LRESULT CALLBACK WindowProc(
      HWND hwnd,       // handle to window
      UINT uMsg,       // WM_TIMER
      WPARAM wParam,   // timer identifier
      LPARAM lParam    // timer callback (TIMERPROC)
    );

Parameters

Return Values

An application should return zero if it processes this message.

Remarks

You can process the message by providing a WM_TIMER case in the window procedure. Otherwise, the default window procedure will call the TimerProc callback function specified in the call to the SetTimer function used to install the timer.

The WM_TIMER message is a low-priority message. The GetMessage and PeekMessage functions post this message only when no other higher-priority messages are in the thread's message queue.

Requirements

  Windows NT/2000 or later: Requires Windows NT 3.1 or later.
  Windows 95/98/Me: Requires Windows 95 or later.
  Header: Declared in Winuser.h; include Windows.h.

Start the timer:

Kill the timer:


Prototype

on_timer(HWND hwnd, UINT id)
{
}

windows_programming_notes.nbk: Home | Index | Next Page: win32 notifications | Previous Page: win32 msgs: WM_TIMECHANGE


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time