Search notes:

Examples for Visual Basic for Application accessing the Windows API: GetSystemMetrics

GetSystemMetrics can be used to retrieve system metrics and configuration settings.
This example needs the VBA declarations of the Windows API which can be found here.
option explicit

sub main() ' {

    debug.print "Number of display monitors on the desktop: " & GetSystemMetrics(SM_CMONITORS  )
    debug.print "Width of primary monitor:                  " & GetSystemMetrics(SM_CXSCREEN   )
    debug.print "Height of primary monitor:                 " & GetSystemMetrics(SM_CYSCREEN   )
    debug.print "Slow (low-end) processor:                  " & GetSystemMetrics(SM_SLOWMACHINE)

end sub ' }
Github repository WinAPI-4-VBA, path: /examples/GetSystemMetrics.bas

See also

Other examples

Index