Platforms to show: All Mac Windows Linux Cross-Platform

WindowsSystemMetricsMBS(what as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method System MBS Win Plugin 3.1 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The WindowsSystemMetrics function retrieves various system metrics (widths and heights of display elements) and system configuration settings.
Example
const SM_CYSMICON = 50

MsgBox str(WindowsSystemMetricsMBS(SM_CYSMICON))

All dimensions retrieved by GetSystemMetrics are in pixels.
If the function fails, the return value is zero.

Values for the what parameter:
SM_ARRANGE56Flags specifying how the system arranged minimized windows. For more information about minimized windows, see the following Remarks section.
SM_CLEANBOOT67Value that specifies how the system was started: 0 Normal boot; 1 Fail-safe boot; 2 Fail-safe with network boot; Fail-safe boot (also called SafeBoot) bypasses the user's startup files.
SM_CMETRICS83(Windows 2000 or newer)
SM_CMONITORS80Number of display monitors on the desktop. (Windows 2000 or newer)
SM_CMOUSEBUTTONS43Number of buttons on mouse, or zero if no mouse is installed.
SM_CXBORDER5Width, in pixels, of a window border.
SM_CXCURSOR13Width, in pixels, of a cursor. The system cannot create cursors of other sizes.
SM_CXDLGFRAME7Thickness, in pixels, of the sizing border around the perimeter of a window that can be resized. (or SM_CXFIXEDFRAME)
SM_CXDOUBLECLK36Width, in pixels, of the rectangle around the location of a first click in a double-click sequence. The second click must occur within this rectangle for the system to consider the two clicks a double-click. (The two clicks must also occur within a specified time.)
SM_CXDRAG68Width, in pixels, of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. This allows the user to click and release the mouse button easily without unintentionally starting a drag operation.
SM_CXEDGE45Width, in pixels, of a 3-D border.
SM_CXFRAME32Thickness, in pixels, of the sizing border around the perimeter of a window that can be resized. (or SM_CXSIZEFRAME)
SM_CXFULLSCREEN16Width of the client area for a full-screen window on the primary display monitor.
SM_CXHSCROLL21Width, in pixels, of the arrow bitmap on a horizontal scroll bar.
SM_CXHTHUMB10Width, in pixels, of the thumb box in a horizontal scroll bar.
SM_CXICON11The default width, in pixels, of an icon. TheLoadIcon function can load only icons of these dimensions.
SM_CXICONSPACING38Width, in pixels, of a grid cell for items in large icon view. Each item fits into a rectangle of this size when arranged. These values are always greater than or equal to SM_CXICON and SM_CYICON.
SM_CXMAXIMIZED61Default width, in pixels, of a maximized top-level window on the primary display monitor.
SM_CXMAXTRACK59Default maximum width, in pixels, of a window that has a caption and sizing borders. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions.
SM_CXMENUCHECK71Width, in pixels, of the default menu check-mark bitmap.
SM_CXMENUSIZE54Width, in pixels, of menu bar buttons, such as the child window close button used in the multiple document interface.
SM_CXMIN28Minimum width, in pixels, of a window.
SM_CXMINIMIZED57Width, in pixels, of a normal minimized window.
SM_CXMINSPACING47Width, in pixels, of a grid cell for minimized windows. Each minimized window fits into a rectangle this size when arranged. These values are always greater than or equal to SM_CXMINIMIZED and SM_CYMINIMIZED.
SM_CXMINTRACK34Minimum tracking width, in pixels, of a window. The user cannot drag the window frame to a size smaller than these dimensions. A window can override these values by processing the WM_GETMINMAXINFO message.
SM_CXSCREEN0Width, in pixels, of the screen of the primary display monitor.
SM_CXSIZE30Width, in pixels, of a button in a window's caption or title bar.
SM_CXSMICON49Recommended width, in pixels, of a small icon. Small icons typically appear in window captions and in small icon view.
SM_CXSMSIZE52Width, in pixels, of small caption buttons.
SM_CXVIRTUALSCREEN78Width, in pixels, of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. (Windows 98/ME and 2000 or newer)
SM_CXVSCROLL2Width, in pixels, of a vertical scroll bar; and height, in pixels, of the arrow bitmap on a vertical scroll bar.
SM_CYBORDER6Height, in pixels, of a window border.
SM_CYCAPTION4Height, in pixels, of a normal caption area.
SM_CYCURSOR14Height, in pixels, of a cursor. The system cannot create cursors of other sizes.
SM_CYDLGFRAME8Thickness, in pixels, of the frame around the perimeter of a window that has a caption but is not sizable. (or SM_CYFIXEDFRAME)
SM_CYDOUBLECLK37Height, in pixels, of the rectangle around the location of a first click in a double-click sequence. The second click must occur within this rectangle for the system to consider the two clicks a double-click. (The two clicks must also occur within a specified time.)
SM_CYDRAG69Height, in pixels, of a rectangle centered on a drag point to allow for limited movement of the mouse pointer before a drag operation begins. This allows the user to click and release the mouse button easily without unintentionally starting a drag operation.
SM_CYEDGE46Height, in pixels, of a 3-D border.
SM_CYFRAME33Thickness, in pixels, of the frame around the perimeter of a window that has a caption but is not sizable. (or SM_CYSIZEFRAME)
SM_CYFULLSCREEN17Height of the client area for a full-screen window on the primary display monitor.
SM_CYHSCROLL3Height, in pixels, of a horizontal scroll bar.
SM_CYICON12The default height, in pixels, of an icon. TheLoadIcon function can load only icons of these dimensions.
SM_CYICONSPACING39Height, in pixels, of a grid cell for items in large icon view. Each item fits into a rectangle of this size when arranged. These values are always greater than or equal to SM_CXICON and SM_CYICON.
SM_CYKANJIWINDOW18For double-byte character set versions of the system, this is the height, in pixels, of the Kanji window at the bottom of the screen.
SM_CYMAXIMIZED62Default height, in pixels, of a maximized top-level window on the primary display monitor.
SM_CYMAXTRACK60Default maximum height, in pixels, of a window that has a caption and sizing borders. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions.
SM_CYMENU15Height, in pixels, of a single-line menu bar.
SM_CYMENUCHECK72Height, in pixels, of the default menu check-mark bitmap.
SM_CYMENUSIZE55Height, in pixels, of menu bar buttons, such as the child window close button used in the multiple document interface.
SM_CYMIN29Minimum height, in pixels, of a window.
SM_CYMINIMIZED58Height, in pixels, of a normal minimized window.
SM_CYMINSPACING48Height, in pixels, of a grid cell for minimized windows. Each minimized window fits into a rectangle this size when arranged. These values are always greater than or equal to SM_CXMINIMIZED and SM_CYMINIMIZED.
SM_CYMINTRACK35Minimum tracking height, in pixels, of a window. The user cannot drag the window frame to a size smaller than these dimensions. A window can override these values by processing the WM_GETMINMAXINFO message.
SM_CYSCREEN1Height, in pixels, of the screen of the primary display monitor.
SM_CYSIZE31Height, in pixels, of a button in a window's caption or title bar.
SM_CYSMCAPTION51Height, in pixels, of a small caption.
SM_CYSMICON50Recommended height, in pixels, of a small icon. Small icons typically appear in window captions and in small icon view.
SM_CYSMSIZE53Height, in pixels, of small caption buttons.
SM_CYVIRTUALSCREEN79Height, in pixels, of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. (Windows 98/ME and 2000 or newer)
SM_CYVSCROLL20Height, in pixels, of a vertical scroll bar; and height, in pixels, of the arrow bitmap on a vertical scroll bar.
SM_CYVTHUMB9Height, in pixels, of the thumb box in a vertical scroll bar.
SM_DBCSENABLED42TRUE or nonzero if the double-byte character set (DBCS) version of USER.EXE is installed; FALSE or zero otherwise.
SM_DEBUG22TRUE or nonzero if the debugging version of USER.EXE is installed; FALSE or zero otherwise.
SM_IMMENABLED82(Windows 2000 or newer)
SM_MENUDROPALIGNMENT40TRUE or nonzero if drop-down menus are right-aligned with the corresponding menu-bar item; FALSE or zero if the menus are left-aligned.
SM_MIDEASTENABLED74TRUE if the system is enabled for Hebrew and Arabic languages.
SM_MOUSEPRESENT19TRUE or nonzero if a mouse is installed; FALSE or zero otherwise.
SM_MOUSEWHEELPRESENT75TRUE or nonzero if a mouse with a wheel is installed; FALSE or zero otherwise. (Windows 98/ME/2000 or newer)
SM_NETWORK63The least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use
SM_PENWINDOWS41TRUE or nonzero if the Microsoft Windows for Pen computing extensions are installed; FALSE or zero otherwise.
SM_REMOTESESSION&h1000(Windows 2000 or newer)
SM_SAMEDISPLAYFORMAT81TRUE if all the display monitors have the same color format, FALSE otherwise. Note that two displays can have the same bit depth, but different color formats. For example, the red, green, and blue pixels can be encoded with different numbers of bits, or those bits can be located in different places in a pixel's color value. (Windows 98/ME/2000 or newer)
SM_SECURE44TRUE if security is present; FALSE otherwise.
SM_SHOWSOUNDS70TRUE or nonzero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; FALSE, or zero, otherwise.
SM_SLOWMACHINE73TRUE if the computer has a low-end (slow) processor; FALSE otherwise.
SM_SWAPBUTTON23TRUE or nonzero if the meanings of the left and right mouse buttons are swapped; FALSE or zero otherwise.
SM_XVIRTUALSCREEN76Coordinates for the left side and the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. (Windows 98/ME/2000 or newer)
SM_YVIRTUALSCREEN77Coordinates for the left side and the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. (Windows 98/ME/2000 or newer)

The SM_ARRANGE setting specifies how the system arranges minimized windows, and consists of a starting position and a direction. The starting position can be one of the following values:
ARW_BOTTOMLEFT 0x0000LStart at the lower-left corner of the screen (default position).
ARW_BOTTOMRIGHT 0x0001LStart at the lower-right corner of the screen. Equivalent to ARW_STARTRIGHT.
ARW_HIDE 0x0008LHide minimized windows by moving them off the visible area of the screen.
ARW_TOPLEFT 0x0002LStart at the upper-left corner of the screen. Equivalent to ARV_STARTTOP.
ARW_TOPRIGHT 0x0003LStart at the upper-right corner of the screen. Equivalent to ARW_STARTTOP | SRW_STARTRIGHT.


The direction in which to arrange can be one of the following values:
ARW_DOWN 0x0004LArrange vertically, top to bottom.
ARW_LEFT 0x0000LArrange horizontally, left to right.
ARW_RIGHT 0x0000LArrange horizontally, right to left.
ARW_UP 0x0004LArrange vertically, bottom to top.

see also
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724385(v=vs.85).aspx

Some examples using this global method:

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...