VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

ChangeRes

ScAnFrEaK  (1 Submission)   Miscellaneous   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

This Function will change your Windows Resolution. It is very simple, and it does what most Resolution Change Functions don't do, it changes the the Bits Per Pixels as well as the Screen Width and Height.

Inputs
Dim RetValue As Integer RetValue = ChangeRes(800, 600, 32)

Returns
1 = Resolution Successfully Changed 0 = Resolution Was Not Changed

API Declarations
Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean
Private Declare Function ChangeDisplaySettings Lib "user32" Alias "ChangeDisplaySettingsA" (lpDevMode As Any, ByVal dwflags As Long) As Long
Private Const CCDEVICENAME = 32
Private Const CCFORMNAME = 32
Private Const DM_BITSPERPEL = &H60000
Private Const DM_PELSWIDTH = &H80000
Private Const DM_PELSHEIGHT = &H100000
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

Rate ChangeRes (3(3 Vote))
ChangeRes.bas

ChangeRes Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters