GetMouse
GetMouse [ /W=winName ]
The GetMouse operation returns information about the position of the input mouse, and the state of the mouse buttons.
GetMouse is useful in situations such as background tasks where the mouse position and state aren't available as they are in control procedures and window hook functions.
Flags
| /W=winName | Returns the mouse position relative to the named window or subwindow. When identifying a subwindow with winName, see Subwindow Syntax. | |
| /W=kwTopWin | Returns the mouse position relative to the currently frontmost non-floating window. | |
| /W=kwCmdHist | Returns the mouse position relative to the command window. | |
| /W=Procedure | Returns the mouse position relative to the main Procedure window. | |
Details
GetMouse returns the mouse position in local coordinates relative to the specified window unless /W is omitted in which case the returned coordinates are global.
Global coordinates are actually relative to the frame window. See GetWindow wsizeDC kwFrameInner.
Information is returned via the following string and numeric variables:
| V_left | Horizontal mouse position, in pixels. | ||||
| V_top | Vertical mouse position, in pixels. | ||||
| V_flag | Mouse button state. V_flag is a bitwise value with each bit reporting the mouse button states: | ||||
| |||||
| See Setting Bit Parameters for details about bit settings. | |||||
| S_name | Name of the window or subwindow which the position is relative to, or "" if not a nameable window or if /W was omitted. Most useful with /W=kwTopWin. The result can be kwCmdHist or Procedure, or the name of a target window. | ||||
See Also
GetWindow, GetKeyState, SetWindow, WMWinHookStruct, WMButtonAction, Background Tasks, Subwindow Syntax