|
|
|
Click here to copy the following block | Const DM_BITSPERPEL As Long = &H40000 Const DM_PELSWIDTH As Long = &H80000 Const DM_PELSHEIGHT As Long = &H100000
Const CCDEVICENAME As Long = 32 Const CCFORMNAME As Long = 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 Long 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 modeIndex As Long, lpDevMode As Any) As Boolean
Sub GetDisplaySettings(displayInfo() As Long, displayDescr() As String) Dim lpDevMode As DEVMODE Dim index As Long Dim displayCount As Long Dim colorDescr As String lpDevMode.dmSize = Len(lpDevMode) lpDevMode.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_BITSPERPEL Do While EnumDisplaySettings(0, displayCount, lpDevMode) > 0 displayCount = displayCount + 1 Loop ReDim displayInfo(0 To displayCount - 1, 0 To 3) As Long ReDim displayDescr(0 To displayCount - 1) As String For index = 0 To displayCount - 1 EnumDisplaySettings 0, index, lpDevMode displayInfo(index, 0) = lpDevMode.dmPelsWidth displayInfo(index, 1) = lpDevMode.dmPelsHeight displayInfo(index, 2) = 2 ^ IIf(lpDevMode.dmBitsPerPel > 24, 24, _ lpDevMode.dmBitsPerPel) If lpDevMode.dmDisplayFrequency > 1 Then displayInfo(index, 0) = lpDevMode.dmDisplayFrequency End If Select Case displayInfo(index, 2) Case 16 colorDescr = "16 colors" Case 256 colorDescr = "256 colors" Case Is <= 65536 colorDescr = "High color" Case Else colorDescr = "True color" End Select displayDescr(index) = lpDevMode.dmPelsWidth & " x " & _ lpDevMode.dmPelsHeight & ", " & colorDescr If lpDevMode.dmDisplayFrequency > 1 Then displayDescr(index) = displayDescr(index) & ", " & _ lpDevMode.dmDisplayFrequency & " MHz" End If Next
End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|