sync on : sync rate 30 : sync
#constant SMMIN 0
#constant SMMAX 95
`SM = System Metrics
type system_metrics
id as integer ` SM ID
value as integer ` SM Function Return Value
decode as string ` SM Function Value
desc as string ` SM Function Description Text
endtype
dim SM(SMMAX) as system_metrics
`get counts first to avoid the array insert at ... command
restore READSMINFO
count=-1
repeat
read id,txt1$,txt2$
inc count
until id = -1
dim SMX(count) as system_metrics
restore READSMINFO
count=-1
repeat
read id,txt1$,txt2$
inc count
SMX(count).id=id : SMX(count).decode=txt1$ : SMX(count).desc=txt2$
until id=-1
user32 = find free dll()
load dll "user32.dll", user32
if dll exist(1)=1
print "dll exists and loaded ok."
else
end
endif
out$="user32_SM_output.txt"
if file exist(out$)=1 then delete file out$
open to write 1,out$
for i=SMMIN to SMMAX
SM(i).id=i
SM(i).value=call dll(user32,"GetSystemMetrics",i)
for t=0 to array count(SMX())
if SM(i).id = SMX(t).id
SM(i).decode=SMX(t).decode
SM(i).desc=SMX(t).desc
exit
endif
next t
print SM(i).id;" -> ";SM(i).value; " : ";SM(i).decode; " : ";SM(i).desc
write string 1, str$(SM(i).id)+" -> "+str$(SM(i).value)+" : "+SM(i).decode+" : "+SM(i).desc
next i
print call dll(user32,"GetSystemMetrics",0x1000)
print call dll(user32,"GetSystemMetrics",0x2000)
print call dll(user32,"GetSystemMetrics",0x2001)
print call dll(user32,"GetSystemMetrics",0x2003)
print call dll(user32,"GetSystemMetrics",0x2004)
close file 1
delete dll user32
sync
wait key
end
`data 0x1000,"SM_REMOTESESSION","This system metric is used in a Terminal Services environment. If the calling process is associated with a Terminal Services client session, the return value is nonzero. If the calling process is associated with the Terminal Services console session, the return value is 0. Windows Server 2003 and Windows XP: The console session is not necessarily the physical console. For more information, see WTSGetActiveConsoleSessionId."
`data 0x2000,"SM_SHUTTINGDOWN","Nonzero if the current session is shutting down; otherwise, 0."
`data 0x2001,"SM_REMOTECONTROL","This system metric is used in a Terminal Services environment to determine if the current Terminal Server session is being remotely controlled. Its value is nonzero if the current session is remotely controlled; otherwise, 0."
`data 0x2003,"SM_CONVERTIBLESLATEMODE","Reflects the state of the laptop or slate mode, 0 for Slate Mode and non-zero otherwise. When this system metric changes, the system sends a broadcast message via WM_SETTINGCHANGE with "ConvertibleSlateMode" in the LPARAM. Note that this system metric doesn't apply to desktop PCs. In that case, use GetAutoRotationState.
`data 0x2004,"SM_SYSTEMDOCKED","Reflects the state of the docking mode, 0 for Undocked Mode and non-zero otherwise. When this system metric changes, the system sends a broadcast message via WM_SETTINGCHANGE with "SystemDockMode" in the LPARAM."
READSMINFO:
data 0,"SM_CXSCREEN","The width of the screen of the primary display monitor, in pixels. This is the same value obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, HORZRES)."
data 1,"SM_CYSCREEN","The height of the screen of the primary display monitor, in pixels. This is the same value obtained by calling GetDeviceCaps as follows: GetDeviceCaps( hdcPrimaryMonitor, VERTRES)."
data 2,"SM_CXVSCROLL","The width of a vertical scroll bar, in pixels."
data 3,"SM_CYHSCROLL","The height of a horizontal scroll bar, in pixels."
data 4,"SM_CYCAPTION","The height of a caption area, in pixels."
data 5,"SM_CXBORDER","The width of a window border, in pixels. This is equivalent to the SM_CXEDGE value for windows with the 3-D look."
data 6,"SM_CYBORDER","The height of a window border, in pixels. This is equivalent to the SM_CYEDGE value for windows with the 3-D look."
data 7,"SM_CXDLGFRAME","This value is the same as SM_CXFIXEDFRAME."
data 8,"SM_CYDLGFRAME","This value is the same as SM_CYFIXEDFRAME."
data 9,"SM_CYVTHUMB","The height of the thumb box in a vertical scroll bar, in pixels."
data 10,"SM_CXHTHUMB","The width of the thumb box in a horizontal scroll bar, in pixels."
data 11,"SM_CXICON","The default width of an icon, in pixels. The LoadIcon function can load only icons with the dimensions that SM_CXICON and SM_CYICON specifies."
data 12,"SM_CYICON","The default height of an icon, in pixels. The LoadIcon function can load only icons with the dimensions SM_CXICON and SM_CYICON."
data 13,"SM_CXCURSOR","The width of a cursor, in pixels. The system cannot create cursors of other sizes."
data 14,"SM_CYCURSOR","The height of a cursor, in pixels. The system cannot create cursors of other sizes."
data 15,"SM_CYMENU","The height of a single-line menu bar, in pixels."
data 16,"SM_CXFULLSCREEN","The width of the client area for a full-screen window on the primary display monitor, in pixels. To get the coordinates of the portion of the screen that is not obscured by the system taskbar or by application desktop toolbars, call the SystemParametersInfo function with the SPI_GETWORKAREA value."
data 17,"SM_CYFULLSCREEN","The height of the client area for a full-screen window on the primary display monitor, in pixels. To get the coordinates of the portion of the screen not obscured by the system taskbar or by application desktop toolbars, call the SystemParametersInfo function with the SPI_GETWORKAREA value."
data 18,"SM_CYKANJIWINDOW","For double byte character set versions of the system, this is the height of the Kanji window at the bottom of the screen, in pixels."
data 19,"SM_MOUSEPRESENT","Nonzero if a mouse is installed; otherwise, 0. This value is rarely zero, because of support for virtual mice and because some systems detect the presence of the port instead of the presence of a mouse."
data 20,"SM_CYVSCROLL","The height of the arrow bitmap on a vertical scroll bar, in pixels."
data 21,"SM_CXHSCROLL","The width of the arrow bitmap on a horizontal scroll bar, in pixels."
data 22,"SM_DEBUG","Nonzero if the debug version of User.exe is installed; otherwise, 0."
data 23,"SM_SWAPBUTTON","Nonzero if the meanings of the left and right mouse buttons are swapped; otherwise, 0."
data 28,"SM_CXMIN","The minimum width of a window, in pixels."
data 29,"SM_CYMIN","The minimum height of a window, in pixels."
data 30,"SM_CXSIZE","The width of a button in a window caption or title bar, in pixels."
data 31,"SM_CYSIZE","The height of a button in a window caption or title bar, in pixels."
data 32,"SM_CXFRAME","This value is the same as SM_CXSIZEFRAME."
data 33,"SM_CYFRAME","This value is the same as SM_CYSIZEFRAME."
data 34,"SM_CXMINTRACK","The minimum tracking width of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message."
data 35,"SM_CYMINTRACK","The minimum tracking height of a window, in pixels. The user cannot drag the window frame to a size smaller than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message."
data 36,"SM_CXDOUBLECLK","The width of the rectangle around the location of a first click in a double-click sequence, in pixels. The second click must occur within the rectangle that is defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click. The two clicks must also occur within a specified time."
data 37,"SM_CYDOUBLECLK","The height of the rectangle around the location of a first click in a double-click sequence, in pixels. The second click must occur within the rectangle defined by SM_CXDOUBLECLK and SM_CYDOUBLECLK for the system to consider the two clicks a double-click. The two clicks must also occur within a specified time."
data 38,"SM_CXICONSPACING","The width of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CXICON."
data 39,"SM_CYICONSPACING","The height of a grid cell for items in large icon view, in pixels. Each item fits into a rectangle of size SM_CXICONSPACING by SM_CYICONSPACING when arranged. This value is always greater than or equal to SM_CYICON."
data 40,"SM_MENUDROPALIGNMENT","Nonzero if drop-down menus are right-aligned with the corresponding menu-bar item; 0 if the menus are left-aligned."
data 41,"SM_PENWINDOWS","Nonzero if the Microsoft Windows for Pen computing extensions are installed; zero otherwise."
data 42,"SM_DBCSENABLED","Nonzero if User32.dll supports DBCS; otherwise, 0."
data 43,"SM_CMOUSEBUTTONS","The number of buttons on a mouse, or zero if no mouse is installed."
data 44,"SM_SECURE","This system metric should be ignored; it always returns 0."
data 45,"SM_CXEDGE","The width of a 3-D border, in pixels. This metric is the 3-D counterpart of SM_CXBORDER."
data 46,"SM_CYEDGE","The height of a 3-D border, in pixels. This is the 3-D counterpart of SM_CYBORDER."
data 47,"SM_CXMINSPACING","The width of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CXMINIMIZED."
data 48,"SM_CYMINSPACING","The height of a grid cell for a minimized window, in pixels. Each minimized window fits into a rectangle this size when arranged. This value is always greater than or equal to SM_CYMINIMIZED."
data 49,"SM_CXSMICON","The recommended width of a small icon, in pixels. Small icons typically appear in window captions and in small icon view."
data 50,"SM_CYSMICON","The recommended height of a small icon, in pixels. Small icons typically appear in window captions and in small icon view."
data 51,"SM_CYSMCAPTION","The height of a small caption, in pixels."
data 52,"SM_CXSMSIZE","The width of small caption buttons, in pixels."
data 53,"SM_CYSMSIZE","The height of small caption buttons, in pixels."
data 54,"SM_CXMENUSIZE","The width of menu bar buttons, such as the child window close button that is used in the multiple document interface, in pixels."
data 55,"SM_CYMENUSIZE","The height of menu bar buttons, such as the child window close button that is used in the multiple document interface, in pixels."
data 56,"SM_ARRANGE","The flags that specify how the system arranged minimized windows."
data 57,"SM_CXMINIMIZED","The width of a minimized window, in pixels."
data 58,"SM_CYMINIMIZED","The height of a minimized window, in pixels."
data 59,"SM_CXMAXTRACK","The default maximum width of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message."
data 60,"SM_CYMAXTRACK","The default maximum height of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message."
data 61,"SM_CXMAXIMIZED","The default width, in pixels, of a maximized top-level window on the primary display monitor."
data 62,"SM_CYMAXIMIZED","The default height, in pixels, of a maximized top-level window on the primary display monitor."
data 63,"SM_NETWORK","The least significant bit is set if a network is present; otherwise, it is cleared. The other bits are reserved for future use."
data 67,"SM_CLEANBOOT","The value that specifies how the system is started: 0 Normal boot 1 Fail-safe boot 2 Fail-safe with network boot"
data 68,"SM_CXDRAG","The number of pixels on either side of a mouse-down point that the mouse pointer can move before a drag operation begins. This allows the user to click and release the mouse button easily without unintentionally starting a drag operation. If this value is negative, it is subtracted from the left of the mouse-down point and added to the right of it."
data 69,"SM_CYDRAG","The number of pixels above and below a mouse-down point that the mouse pointer can move before a drag operation begins. This allows the user to click and release the mouse button easily without unintentionally starting a drag operation. If this value is negative, it is subtracted from above the mouse-down point and added below it."
data 70,"SM_SHOWSOUNDS","Nonzero if the user requires an application to present information visually in situations where it would otherwise present the information only in audible form; otherwise, 0."
data 71,"SM_CXMENUCHECK","The width of the default menu check-mark bitmap, in pixels."
data 72,"SM_CYMENUCHECK","The height of the default menu check-mark bitmap, in pixels."
data 73,"SM_SLOWMACHINE","Nonzero if the computer has a low-end (slow) processor; otherwise, 0."
data 74,"SM_MIDEASTENABLED","Nonzero if the system is enabled for Hebrew and Arabic languages, 0 if not."
data 75,"SM_MOUSEWHEELPRESENT","Nonzero if a mouse with a vertical scroll wheel is installed; otherwise 0."
data 76,"SM_XVIRTUALSCREEN","The coordinates for the left side of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. The SM_CXVIRTUALSCREEN metric is the width of the virtual screen."
data 77,"SM_YVIRTUALSCREEN","The coordinates for the top of the virtual screen. The virtual screen is the bounding rectangle of all display monitors. The SM_CYVIRTUALSCREEN metric is the height of the virtual screen."
data 78,"SM_CXVIRTUALSCREEN","The width of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors. The SM_XVIRTUALSCREEN metric is the coordinates for the left side of the virtual screen."
data 79,"SM_CYVIRTUALSCREEN","The height of the virtual screen, in pixels. The virtual screen is the bounding rectangle of all display monitors. The SM_YVIRTUALSCREEN metric is the coordinates for the top of the virtual screen."
data 80,"SM_CMONITORS","The number of display monitors on a desktop."
data 81,"SM_SAMEDISPLAYFORMAT","Nonzero if all the display monitors have the same color format, otherwise, 0. 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 color value."
data 82,"SM_IMMENABLED","Nonzero if Input Method Manager/Input Method Editor features are enabled; otherwise, 0."
data 83,"SM_CXFOCUSBORDER","The width of the left and right edges of the focus rectangle that the DrawFocusRect draws. This value is in pixels."
data 84,"SM_CYFOCUSBORDER","The height of the top and bottom edges of the focus rectangle drawn by DrawFocusRect. This value is in pixels."
data 86,"SM_TABLETPC","Nonzero if the current operating system is the Windows XP Tablet PC edition or if the current operating system is Windows Vista or Windows 7 and the Tablet PC Input service is started; otherwise, 0. The SM_DIGITIZER setting indicates the type of digitizer input supported by a device running Windows 7 or Windows Server 2008 R2. For more information, see Remarks."
data 87,"SM_MEDIACENTER","Nonzero if the current operating system is the Windows XP, Media Center Edition, 0 if not."
data 88,"SM_STARTER","Nonzero if the current operating system is Windows 7 Starter Edition, Windows Vista Starter, or Windows XP Starter Edition; otherwise, 0."
data 89,"SM_SERVERR2","The build number if the system is Windows Server 2003 R2; otherwise, 0."
data 91,"SM_MOUSEHORIZONTALWHEELPRESENT","Nonzero if a mouse with a horizontal scroll wheel is installed; otherwise 0."
data 92,"SM_CXPADDEDBORDER","The amount of border padding for captioned windows, in pixels."
data 94,"SM_DIGITIZER","Nonzero if the current operating system is Windows 7 or Windows Server 2008 R2 and the Tablet PC Input service is started; otherwise, 0. The return value is a bitmask that specifies the type of digitizer input supported by the device. For more information, see Remarks."
data 95,"SM_MAXIMUMTOUCHES","Nonzero if there are digitizers in the system; otherwise, 0."
data -1,"*","*"
return
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others