Coordinates

Many functions (lef, rig, mid, dou, mou, win, child, pixel, mov, siz, wait) use coordinates x and y to specify a point in the screen or a window.

 

With mouse commands, pixel and wait, if window is omitted or literal 0, coordinates are relative to the top-left corner of the screen or the work area. Otherwise, they are relative to the window or to the client area of the window. Window's client area includes all except border, caption bar, scroll bars and standard menu bar. The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars.

 

If coordinates are integer values, they are interpreted as number of pixels. A pixel is the smallest unit that can be displayed on a monitor. It depends on screen resolution. For example, resolution of 1024x768 means 1024 pixels in horizontal and 768 pixels in vertical. When you move the mouse, in QM status bar you can see mouse pointer coordinates in pixels.

 

If coordinates have type of double (usually from 0.0 to 0.999) then they are interpreted as fraction of the screen, window, client area or child window. For example, mou 0.5 0.5 child("OK" "Button" "Message") moves the mouse to the middle of OK button. Double coordinates cannot be used with user-defined and dll functions.

 

Usually screen coordinates must be relative to the primary monitor. If you want to use coordinates relative to some other monitor, use function XyMonitorToNormal to convert them.