The WM_RBUTTONDBLCLK message tells a window that the right mouse button has been double-clicked while the cursor is inside the window's client area. The information sent with the message identifies the cursor postion relative to the window as well as the state of various modifier keys and mouse buttons. The target window's window procedure processes the message. When handling the message, the GET_X_LPARAM, GET_Y_LPARAM, and MAKEPOINTS macros can be used to unpack the coordinate information easily.
WM_RBUTTONDBLCLK should always return 0.
None.
Const WM_RBUTTONDBLCLK = &H206
Const MK_CONTROL = &H8
Const MK_LBUTTON = &H1
Const MK_MBUTTON = &H10
Const MK_RBUTTON = &H2
Const MK_SHIFT = &H4
Const MK_XBUTTON1 = &H20
Const MK_XBUTTON2 = &H40
' This code is licensed according to the terms and conditions listed here.
' Make window Form1 think that the right mouse button has been
' double-clicked in its center by sending the appropriate message to it.
Dim xcoord As Long, ycoord As Long ' x and y coordinates of the faked cursor position
Dim packed As Long ' the coordinates "packed" into a single 32-bit integer
Dim winrect As RECT ' receives coordinates of the window
Dim retval As Long ' return value
' First, get the coordinates of window Form1.
retval = GetWindowRect(Form1.hWnd, winrect)
' Use the coordinates to calculate the midpoint of Form1.
xcoord = (winrect.right - winrect.left) / 2
ycoord = (winrect.bottom - winrect.top) / 2
' Now pack the coordinates into the appropriate words of the value
packed = (ycoord * &H10000) + xcoord
' Make Form1 think the right mouse button was just double-clicked in that position.
retval = SendMessage(Form1.hWnd, WM_RBUTTONDOWN, ByVal CLng(MK_RBUTTON) , ByVal packed)
retval = SendMessage(Form1.hWnd, WM_RBUTTONUP, ByVal CLng(0), ByVal packed)
retval = SendMessage(Form1.hWnd, WM_RBUTTONDBLCLK, ByVal CLng(MK_RBUTTON), ByVal packed)
retval = SendMessage(Form1.hWnd, WM_RBUTTONUP, ByVal CLng(0), ByVal packed)
WM_LBUTTONDBLCLK, WM_MBUTTONDBLCLK, WM_RBUTTONDOWN, WM_RBUTTONUP
Back to the Message list.
Back to the Reference section.
Last Modified: March 19, 2000
This page is copyright © 2000 Paul Kuliniewicz.
Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/w/wm_rbuttondblclk.html