windows_programming_notes.nbk: Home | Index | Next Page: WM_KILLFOCUS | Previous Page: WM_KEYDOWN


 WM_KEYUP

The WM_KEYUP message is posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.

A window receives this message through its WindowProc function.

    LRESULT CALLBACK WindowProc(
      HWND hwnd,       // handle to window
      UINT uMsg,       // WM_KEYUP
      WPARAM wParam,   // virtual-key code
      LPARAM lParam    // key data
    );

Parameters

Return Values

An application should return zero if it processes this message.

Remarks

The DefWindowProc function sends a WM_SYSCOMMAND message to the top-level window if the F10 key or the ALT key was released. The wParam parameter of the message is set to SC_KEYMENU.

For enhanced 101- and 102-key keyboards, extended keys are the right ALT and CTRL keys on the main section of the keyboard; the INS, DEL, HOME, END, PAGE UP, PAGE DOWN, and arrow keys in the clusters to the left of the numeric keypad; and the divide (/) and ENTER keys in the numeric keypad. Other keyboards may support the extended-key bit in the lParam parameter.

Windows 2000 or later: Applications must pass wParam to TranslateMessage without altering it at all.

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.

windows_programming_notes.nbk: Home | Index | Next Page: WM_KILLFOCUS | Previous Page: WM_KEYDOWN


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