MOUSEINPUT

[This is preliminary documentation and subject to change.]

Carries information about a simulated mouse event.

typedef struct tagMOUSEINPUT {
    LONG    dx;
    LONG    dy;
    DWORD   mouseData;
    DWORD   dwFlags;
    DWORD   dwExtraInfo;
} MOUSEINPUT, FAR* LPMOUSEINPUT;
 

Members

dx and dy
Absolute or relative mouse movement on the x-axis and y-axis, in pixels.

Depending on the flags specified in the dwFlags member of the associated SendInput function call, these members indicate either an absolute position or an amount of movement since the last mouse event occurred. If the MOUSEEVENTF_ABSOLUTE bit is set in the dwFlags member, then these are absolute positions; otherwise they are relative movement values.

mouseData
Value indicating mouse wheel movement. This member is valid only if the dwFlags member contains the MOUSEEVENTF_WHEEL value. If so, then mouseData specifies the amount of wheel movement. A positive value indicates that the wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is defined as WHEEL_DELTA, which is 120.

If the dwFlags member does not contain MOUSEEVENTF_WHEEL, then you must set mouseData to zero.

dwFlags
Bitmask value that can contain a combination of the following values.
MOUSEEVENTF_ABSOLUTE Specifies that the dx and dy members contain normalized absolute coordinates. If the flag is not set, the dx and dy members contain relative data: the change in position since the last reported position. This flag can be set, or not set, regardless of what kind of mouse or other pointing device, if any, is connected to the system.
MOUSEEVENTF_LEFTDOWN Specifies that the left button was pressed.
MOUSEEVENTF_LEFTUP Specifies that the left button was released.
MOUSEEVENTF_MIDDLEDOWN Specifies that the middle button was pressed.
MOUSEEVENTF_MIDDLEUP Specifies that the middle button was released.
MOUSEEVENTF_MOVE Specifies that movement occurred.
MOUSEEVENTF_RIGHTDOWN Specifies that the right button was pressed.
MOUSEEVENTF_RIGHTUP Specifies that the right button was released.
MOUSEEVENTF_WHEEL Windows NT only: Specifies that the wheel was moved, if the mouse has a wheel. The amount of movement is specified in mouseData.

dwExtraInfo
A 32-bit value to be associated with the mouse event. An application can call the GetMessageExtraInfo Win32 function to retrieve this extra information.

Remarks

This structure is contained by the INPUT structure and used with the SendInput function.

See Also

Simulating Input