AW: Bildschirm abfragen
31.03.2014 13:05:36
Hajo_Zi
Hallo Franz,
mit folgender Funktion bekommst Du die Auflösung raus.
Option Explicit
' von Andre bei Herber.de gepostet Quelle unbekannt
Public Declare Function GetDeviceCaps Lib "gdi32" (ByVal hdc As Long, ByVal nIndex As Long) As _
Long
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hcd As Long) As Long
Public lHsize As Long, lVsize As Long
Const HORZRES = 8
Const VERTRES = 10
Function ScreenResolution()
' lHsize = Anzahl der horizontalen Bildschirmzeilen
' lVsize = Anzahl der vertikalen Bildschirmzeilen
Dim lRval As Long
Dim lDc As Long
lDc = GetDC(0&)
lHsize = GetDeviceCaps(lDc, HORZRES)
lVsize = GetDeviceCaps(lDc, VERTRES)
lRval = ReleaseDC(0, lDc)
ScreenResolution = "Vertikal " & lVsize & " Horizontal " & lHsize
End Function