Share via


WM_RBUTTONDOWN (Compact 2013)

3/28/2014

This message is posted when the user presses the right mouse button while the cursor is located within the client area of a window. If another window has not captured the mouse, the OS posts the message to the window beneath the cursor. If another window has captured the mouse, the OS posts the message to the window that has captured the mouse.

A window receives this message through the WindowProc function for the window.

Syntax

WM_RBUTTONDOWN 
    fwKeys = wParam; 
    xPos = LOWORD(lParam); 
    yPos = HIWORD(lParam);

Parameters

  • fwKeys
    Indicates the mouse buttons and keys that the user pressed. The following table shows the possible values, which can be combined.

    Value

    Description

    MK_CONTROL

    The user pressed the CTRL key.

    MK_LBUTTON

    The user pressed the left mouse button.

    MK_MBUTTON

    The user pressed the middle mouse button.

    MK_RBUTTON

    The user pressed the right mouse button.

    MK_SHIFT

    The user pressed the SHIFT key.

  • xPos
    Value of the low-order word of lParam. Specifies the x-coordinate of the pointer, relative to the upper-left corner of the client area.
  • yPos
    Value of the high-order word of lParam. Specifies the y-coordinate of the pointer, relative to the upper-left corner of the client area.

Return Value

An application that processes this message should return zero.

Remarks

To detect that the user pressed the ALT key, pass the VK_MENU value to the GetKeyState function and check whether the return value is less than zero. Do not use the GetAsyncKeyState function for this purpose.

Requirements

Header

windows.h

Library

coredll.lib

See Also

Reference

Mouse Messages
GetAsyncKeyState
GetCapture
GetKeyState
SetCapture
WindowProc
WM_RBUTTONUP