Retrieves screen resolution, multi-monitor info, dimensions of system objects, and other system properties.
SysGet, OutputVar, SubCommand , Value
The OutputVar parameter is the name of the variable in which to store the result. The SubCommand and Value parameters are dependent upon each other and their usage is described below.
For SubCommand, specify one of the following:
Retrieves the total number of monitors.
SysGet, OutputVar, MonitorCount
Unlike SM_CMONITORS mentioned in the table below, this sub-command includes all monitors, even those not being used as part of the desktop.
Retrieves the number of the primary monitor.
SysGet, OutputVar, MonitorPrimary
In a single-monitor system, this will be always 1.
Retrieves the bounding coordinates of monitor number N.
SysGet, OutputVar, Monitor , N
If N is omitted, the primary monitor is used. The information is stored in four variables whose names all start with OutputVar. If N is too high or there is a problem retrieving the info, the variables are all made blank. For example:
SysGet, Mon2, Monitor, 2 MsgBox, Left: %Mon2Left% -- Top: %Mon2Top% -- Right: %Mon2Right% -- Bottom %Mon2Bottom%.
Within a function, to create a set of variables that is global instead of local, declare Mon2 as a global variable prior to using this command (the converse is true for assume-global functions). However, it is often also necessary to declare each variable in the set, due to a common source of confusion.
Retrieves the working area's bounding coordinates of monitor number N.
SysGet, OutputVar, MonitorWorkArea , N
Same as the Monitor sub-command above except the area is reduced to exclude the area occupied by the taskbar and other registered desktop toolbars.
Retrieves the operating system's name of monitor number N.
SysGet, OutputVar, MonitorName , N
If N is omitted, the primary monitor is used.
Specify for SubCommand one of the numbers from the tables below to retrieve the corresponding value.
SysGet, OutputVar, N
The following example would store the number of mouse buttons in a variable named "MouseButtonCount": SysGet, MouseButtonCount, 43.
SysGet, MouseButtonCount, 43
SM_IMMENABLED indicates whether the system is ready to use a Unicode-based IME on a Unicode application. To ensure that a language-dependent IME works, check SM_DBCSENABLED and the system ANSI code page. Otherwise the ANSI-to-Unicode conversion may not be performed correctly, or some components like fonts or registry setting may not be present.
The built-in variables A_ScreenWidth and A_ScreenHeight contain the dimensions of the primary monitor, in pixels.
DllCall, WinGet
SysGet, MouseButtonCount, 43 SysGet, VirtualScreenWidth, 78 SysGet, VirtualScreenHeight, 79
Displays info about each monitor:
SysGet, MonitorCount, MonitorCount SysGet, MonitorPrimary, MonitorPrimary MsgBox, Monitor Count:`t%MonitorCount%`nPrimary Monitor:`t%MonitorPrimary% Loop, %MonitorCount% { SysGet, MonitorName, MonitorName, %A_Index% SysGet, Monitor, Monitor, %A_Index% SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index% MsgBox, Monitor:`t#%A_Index%`nName:`t%MonitorName%`nLeft:`t%MonitorLeft% (%MonitorWorkAreaLeft% work)`nTop:`t%MonitorTop% (%MonitorWorkAreaTop% work)`nRight:`t%MonitorRight% (%MonitorWorkAreaRight% work)`nBottom:`t%MonitorBottom% (%MonitorWorkAreaBottom% work) }