VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Enum the supported display resolutions, change resolution and detect the display change message fro

Michael Wong  (1 Submission)   Windows API Call/Explanation   Visual Basic 5.0   Unknown Difficulty   Sun 14th February 1999   Mon 8th February 2021

Enum the supported display resolutions, change resolution and detect the display change message from Windows.

API Declarations


Public Const WM_DISPLAYCHANGE = &H7E

Public Const DISP_CHANGE_SUCCESSFUL = 0
Public Const DISP_CHANGE_RESTART = 1
Public Const DISP_CHANGE_FAILED = -1
Public Const DISP_CHANGE_BADMODE = -2
Public Const DISP_CHANGE_NOTUPDATED = -3
Public Const DISP_CHANGE_BADFLAGS = -4
Public Const DISP_CHANGE_BADPARAM = -5
Public Const CDS_UPDATEREGISTRY = 1
Public Const DM_BITSPERPEL = &H40000
Public Const DM_PELSHEIGHT = &H100000
Public Const DM_PELSWIDTH = &H80000


Public Type DevMode
dmDeviceName As String * 32
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 * 32
dmLogPixels As Integer
dmBitsPerPel As Long
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
dmICMMethod As Long ' Windows 95 only
dmICMIntent As Long ' Windows 95 only
dmMediaType As Long ' Windows 95 only
dmDitherType As Long ' Windows 95 only
dmICCManufacturer As Long ' Windows 95 only
dmICCModel As Long ' Windows 95 only
dmPanningWidth As Long ' Windows 95 only
dmPanningHeight As Long ' Windows 95 only
End Type

Public Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long

Public Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal MSG As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Public Declare Function ChangeDisplaySettings Lib "user32" Alias "ChangeDisplaySettingsA" (lpDevMode As DevMode, ByVal dwFlags As Long) As Long

Public Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As String, ByVal iModeNum As Long, lpDevMode As DevMode) As Long

Rate Enum the supported display resolutions, change resolution and detect the display change message fro (1(1 Vote))
Enum the supported display resolutions, change resolution and detect the display change message fro.bas

Enum the supported display resolutions, change resolution and detect the display change message fro Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters