Für dieses Beispiel benötigen Sie ein Formular, Autoredraw=True.
QUELLE: MSDN
Private Declare Function GetSystemMetrics Lib "user32.dll" _
(ByVal nIndex As Long) As Long
Private Const SM_CXSCREEN As Long = 0& ' Desktop-Breite
Private Const SM_CYSCREEN As Long = 1& ' Desktop-Höhe
Private Const SM_CXVSCROLL As Long = 2& ' vert. Breite ScrollBar
Private Const SM_CYHSCROLL As Long = 3& ' horiz. Höhe ScrollBar
Private Const SM_CYCAPTION As Long = 4& ' Höhe d. Caption /Titels
Private Const SM_CXBORDER As Long = 5& ' Dicke d. FensterRandes horz.
Private Const SM_CYBORDER As Long = 6& ' Dicke d. FensterRandes vert.
Private Const SM_CXDLGFRAME As Long = 7& ' Width of dialog frame window
Private Const SM_CYDLGFRAME As Long = 8& ' Height of dialog frame window
Private Const SM_CYVTHUMB As Long = 9& ' Width of scroll box (thumb) on vertical scroll bar
Private Const SM_CXHTHUMB As Long = 10& ' Width of scroll box (thumb) on horizontal scroll bar
Private Const SM_CXICON As Long = 11& ' Icon-Breite
Private Const SM_CYICON As Long = 12& ' Icon-Höhe
Private Const SM_CXCURSOR As Long = 13& ' Cursor-Breite
Private Const SM_CYCURSOR As Long = 14& ' Cursor-Höhe
Private Const SM_CYMENU As Long = 15& ' Höhe d. Menüs
Private Const SM_CXFULLSCREEN As Long = 16& ' Breite d. Client-Bereichs
Private Const SM_CYFULLSCREEN As Long = 17& ' Höhe d. Client-Bereichs
Private Const SM_CYKANJIWINDOW As Long = 18& '
Private Const SM_MOUSEPRESENT As Long = 19& ' Mouse vorhanden (True)
Private Const SM_CYVSCROLL As Long = 20& ' vert. Höhe ScrollBar
Private Const SM_CXHSCROLL As Long = 21& ' horiz. Breite ScrollBar
Private Const SM_DEBUG As Long = 22& ' Debug-Version v. Windows (User.exe)
Private Const SM_SWAPBUTTON As Long = 23& ' MouseTasten vertauscht
Private Const SM_RESERVED1 = 24
Private Const SM_RESERVED2 = 25
Private Const SM_RESERVED3 = 26
Private Const SM_RESERVED4 = 27
Private Const SM_CXMIN As Long = 28& ' minim. Breite d. Fensters
Private Const SM_CYMIN As Long = 29& ' minim. Höhe d. Fensters
Private Const SM_CXSIZE As Long = 30& ' Width of bitmaps in title bar
Private Const SM_CYSIZE As Long = 31& ' Height of bitmaps in title bar
Private Const SM_CXFRAME As Long = 32& ' Width of window frame
Private Const SM_CYFRAME As Long = 33& ' Height of window frame
Private Const SM_CXMINTRACK As Long = 34& ' Minimum tracking width of window
Private Const SM_CYMINTRACK As Long = 35& ' Minimum tracking height of window
Private Const SM_CXDOUBLECLK As Long = 36& ' DoppelKlick-Rect Breite
Private Const SM_CYDOUBLECLK As Long = 37& ' DoppelKlick-Rect Höhe
Private Const SM_CXICONSPACING As Long = 38& ' horiz. Icon-Abstand
Private Const SM_CYICONSPACING As Long = 39& ' vert. Icon-Abstand
Private Const SM_MENUDROPALIGNMENT As Long = 40& ' Menü-Ausrichtung
Private Const SM_PENWINDOWS As Long = 41& ' Pen.Dll-Handle
Private Const SM_DBCSENABLED As Long = 42& ' DblByte-Character enabled
Private Const SM_CMOUSEBUTTONS As Long = 43& ' Anzahl d. MouseTasten
Private Const SM_CMETRICS As Long = 44& '
Private Const SM_CXEDGE As Long = 45& ' Dicke d. 3DFensterRandes horz.
Private Const SM_CYEDGE As Long = 46& ' Dicke d. 3DFensterRandes vert.
Private Const SM_NETWORK As Long = 63& ' Netz installiert
Private Const SM_MOUSEWHEELPRESENT As Long = 75& ' MausRad vorhanden (True)
Private Const SM_CMONITORS As Long = 80& ' Anzahl Bildschirme
Private Const SM_SAMEDISPLAYFORMAT As Long = 81& '
Private Sub Form_Load()
Me.AutoRedraw = True
' Horizontaler Icon-Abstand
Me.Print GetSystemMetrics(SM_CXICONSPACING)
' Vertikaler Icon-Abstand
Me.Print GetSystemMetrics(SM_CYICONSPACING)
' Icon-Höhe
Me.Print GetSystemMetrics(SM_CXICON)
' Icon-Breite
Me.Print GetSystemMetrics(SM_CYICON)
' und so weiter...
End Sub