# GetRelativeMouseState

int GetRelativeMouseState (int panelHandle, int controlID, int *xCoordinate, int *yCoordinate, int *leftButtonDown, int *rightButtonDown, int *keyModifiers);

## Purpose

Obtains information about the state of the mouse cursor. xCoordinate and yCoordinate return the position of the mouse relative to the top and left coordinates of a specific control. If you pass zero as the controlID, the coordinate information references the top and left coordinates of the panel, excluding the panel frame and title bar. GetRelativeMouseState returns the coordinates even if the mouse is not over the control or the panel.

## Parameters

Input
Name | Type | Description
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
controlID | integer | Defined constant, located in the .uir header file, that you assign to the control in the User Interface Editor, or the ID that you obtain from NewCtrl or DuplicateCtrl. You can pass 0 if you want the coordinate information to be relative to the top and left coordinates of the panel, excluding the frame and title bar.
Output
Name | Type | Description
xCoordinate | integer | X-coordinate of the mouse cursor relative to the left edge of the control, or panel, if controlID is 0. You can pass NULL.
yCoordinate | integer | Y-coordinate of the mouse cursor relative to the top of the control, or panel, if controlID is 0. You can pass NULL.
leftButtonDown | integer | The state of the left mouse button. 0 if the left button is up. 1 if the left button is down. You can pass NULL.
rightButtonDown | integer | The state of the right mouse button. 0 if the right button is up. 1 if the right button is down. You can pass NULL.
keyModifiers | integer | State of the keyboard modifiers, in other words, the <Ctrl>, <Alt>, and <Shift> keys. If no keys are down, the value is 0. Otherwise, the value is the bitwise OR of the appropriate key masks: VAL_MENUKEY_MODIFIER, VAL_UNDERLINE_MODIFIER, VAL_SHIFT_MODIFIER, and VAL_SHIFT_AND_MENUKEY. You can pass NULL.

## Return Value

Name | Type | Description
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
Code | Error Message String
xx | Success