·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



Zwei Commandbuttons und Sie erfahren die Abmessungen des Screens sowie die Farbtiefe.

Private Declare Function GetDC Lib "user32" _
(ByVal hWnd As Long) As Long

Private Declare Function GetDeviceCaps Lib "gdi32" _
(ByVal hdc As Long, ByVal nIndex As Long) As Long

Private Declare Function GetSystemMetrics Lib "user32" _
(ByVal nIndex As Long) As Long
 
Private Sub Command1_Click()
 
    Dim hScreenDc As Long
    hScreenDc = GetDC(0)
 
    ' Gibt die Anzahl der Farben zurück
    ' 32 für TrueColor
    ' 16 für HighColor
    ' 8 für 256 Farben
 
    MsgBox GetDeviceCaps(hScreenDc, 12)
 
End Sub
 
Private Sub Command2_Click()
 
    Dim ScreenH As Integer
    Dim ScreenW As Integer
 
    ScreenW = GetSystemMetrics(0)
    ScreenH = GetSystemMetrics(1)
 
    MsgBox "Bildschirm: " & _
    ScreenW & " x " & ScreenH
 
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.84 ·  Seite erstellt in: 0.238 Sekunden ·  Dateigröße:  2834 Bytes