CoordMode

Sets coordinate mode for various commands to be relative to either the active window or the screen.

CoordMode, TargetType , RelativeTo

Parameters

TargetType

Specify one of the following words to indicate the type of target to affect:

ToolTip: Affects ToolTip.

Pixel: Affects PixelGetColor, PixelSearch, and ImageSearch.

Mouse: Affects MouseGetPos, Click, MouseMove, MouseClick, and MouseClickDrag.

Caret: Affects the built-in variables A_CaretX and A_CaretY.

Menu: Affects the Menu Show command when coordinates are specified for it.

RelativeTo

If blank or omitted, it defaults to Screen. Otherwise, specify one of the following words to indicate the area to which TargetType should be relative:

Screen: Coordinates are relative to the desktop (entire screen).

Relative: Coordinates are relative to the active window.

Window [v1.1.05+]: Synonymous with Relative and recommended for clarity.

Client [v1.1.05+]: Coordinates are relative to the active window's client area, which excludes the window's title bar, menu (if it has a standard one) and borders. Client coordinates are less dependent on OS version and theme.

Remarks

If this command is not used, all commands except those documented otherwise (e.g. WinMove and InputBox) use coordinates that are relative to the active window.

Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts off fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).

[v1.1.23+]: The built-in A_CoordMode variables contain the current settings.

Click, MouseMove, MouseClick, MouseClickDrag, MouseGetPos, PixelGetColor, PixelSearch, ToolTip, Menu

Examples

Places tooltips at absolute screen coordinates.

CoordMode, ToolTip, Screen

Same effect as the above because "Screen" is the default.

CoordMode, ToolTip