|
|
|
Click here to copy the following block |
Option Explicit Private Declare Function lstrcpy Lib "kernel32" Alias "lstrcpyA" (lpString1 As _ Any, lpString2 As Any) As Long Const CCHDEVICENAME = 32 Const CCHFORMNAME = 32 Private Type DEVMODE dmDeviceName As String * CCHDEVICENAME 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 * CCHFORMNAME dmUnusedPadding As Integer dmBitsPerPel As Integer dmPelsWidth As Long dmPelsHeight As Long dmDisplayFlags As Long dmDisplayFrequency As Long End Type Private Declare Function ChangeDisplaySettings Lib "User32" Alias _ "ChangeDisplaySettingsA" (ByVal lsDevMode As Long, ByVal dwFlags _ As Long) As Long
Public Function SetDisplayMode(Width As Integer, Height As Integer, _ Color As Integer) As Long
Const DM_PELSWIDTH = &H80000 Const DM_PELSHEIGHT = &H100000 Const DM_BITSPERPEL = &H40000 Dim NewDevMode As DEVMODE Dim pDevMode As Long With NewDevMode .dmSize = 122 If Color = -1 Then .dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT Else .dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT Or DM_BITSPERPEL End If .dmPelsWidth = Width .dmPelsHeight = Height If Color <> -1 Then .dmBitsPerPel = Color End If End With pDevMode = lstrcpy(NewDevMode, NewDevMode) SetDisplayMode = ChangeDisplaySettings(pDevMode, 0) End Function
i = SetDisplayMode(640, 480, 24) |
|
|
|
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 ) |
|
|