'Example submitted by Guille (guille@wcostasol.es)
'Visit his website at http://guille.costasol.net/
Option Explicit
Const ENUM_CURRENT_SETTINGS As Long = -1&
Const CCDEVICENAME = 32
Const CCFORMNAME = 32
Private Type DEVMODE
dmDeviceName As String * CCDEVICENAME
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * CCFORMNAME
dmUnusedPadding As Integer
dmBitsPerPel As Integer
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
End Type
Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean
Private Sub Form_Load()
Dim DevM As DEVMODE
Call EnumDisplaySettings(0&, ENUM_CURRENT_SETTINGS, DevM)
Debug.Print "Current screen width: " & DevM.dmPelsWidth & " pixels"
Debug.Print "Current screen height: " & DevM.dmPelsHeight & " pixels"
Debug.Print "Current color depth: " & DevM.dmBitsPerPel & " bits/pixel"
End Sub
Сейчас этот форум просматривают: SemrushBot и гости: 78