Is there anyone here that actualy knows how to change the windows screen resolution because all i get from spenind all day on the web is this:
Private Const CCDEVICENAME = 32
Private Const CCFORMNAME = 32
Private Const DM_PELSWIDTH = &H80000
Private Const DM_PELSHEIGHT = &H100000
Private Declare Function EnumDisplaySettings Lib "user32" _
Alias "EnumDisplaySettingsA" _
(ByVal lpszDeviceName As Long, _
ByVal iModeNum As Long, _
ByVal lpDevMode As Long) As Boolean
Private Declare Function ChangeDisplaySettings Lib "user32" _
Alias "ChangeDisplaySettingsA" _
(ByVal lpDevMode As any, _
ByVal dwflags As Long) As Long
Private Type DEVMODE
Dim dmDeviceName As String * CCDEVICENAME
Dim dmSpecVersion As Integer
Dim dmDriverVersion As Integer
Dim dmSize As Integer
Dim dmDriverExtra As Integer
Dim dmFields As Long
Dim dmOrientation As Integer
Dim dmPaperSize As Integer
Dim dmPaperLength As Integer
Dim dmPaperWidth As Integer
Dim dmScale As Integer
Dim dmCopies As Integer
Dim dmDefaultSource As Integer
Dim dmPrintQuality As Integer
Dim dmColor As Integer
Dim dmDuplex As Integer
Dim dmYResolution As Integer
Dim dmTTOption As Integer
Dim dmCollate As Integer
Dim dmFormName As String *CCFORMNAME
Dim dmUnusedPadding As Integer
Dim dmBitsPerPel As Integer
Dim dmPelsWidth As Long
Dim dmPelsHeight As Long
Dim dmDisplayFlags As Long
Dim dmDisplayFrequency As Long
End Type
Private Sub ChangeRes(ByVal iWidth As Single, ByVal iHeight As Single)
Dim blnWorked As Boolean
Dim i As Long
Dim DevM As DEVMODE
i = 0
Do
blnWorked = EnumDisplaySettings(0&, i, DevM)
i = i + 1
Loop Until (blnWorked = False)
With DevM
.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT
.dmPelsWidth = iWidth
.dmPelsHeight = iHeight
End With
Call ChangeDisplaySettings(DevM, 0)
End Sub
This DOES NOT work in
VB.net
the first declaration where it says
as any vb.net does not like. In
vb.net you must declare all variables. that is a change from 6.0 Also type is no longer suported. You must change that to structure. One last thing.
Dim dmDeviceName As String * CCDEVICENAME
Dim dmFormName As String *CCFORMNAME
vb.net basicaly spasims over the floor with these lines. the whole * thing messes it up.
Will anyone help or will u keep posting this useless *sensored*
TY
If you help me im fine, otherwise your MINE.