Sets coordinate mode for various built-in functions to be relative to either the active window or the screen.
CoordMode TargetType , RelativeTo
The type of target to affect. Specify one of the following words:
ToolTip: Affects ToolTip.
Pixel: Affects PixelGetColor, PixelSearch, and ImageSearch.
Mouse: Affects MouseGetPos, Click, and MouseMove/Click/Drag.
Caret: Affects CaretGetPos.
Menu: Affects the Menu.Show method when coordinates are specified for it.
The area to which TargetType is to be related. Specify one of the following words (if omitted, it defaults to Screen):
Screen: Coordinates are relative to the desktop (entire screen).
Window: Coordinates are relative to the active window.
Client: 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.
If this function is not used, all built-in functions except those documented otherwise (e.g. WinMove and InputBox) use coordinates that are relative to the active window's client area.
Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts off fresh with the default setting for this function. That default may be changed by using this function during script startup.
The built-in A_CoordMode variables contain the current settings.
Click, MouseMove, MouseClick, MouseClickDrag, MouseGetPos, PixelGetColor, PixelSearch, ToolTip, Menu.Show