title image

Smiley Versuchs mal damit
Hi JörgOption Compare DatabaseOption Explicit'Gefunden bei: http://www.access-developer.com/'Change Screen Resolution On The Fly'Occasionally you may write an application that requires a specific screen resolution.'Here 's a procedure that changes the screen to the resolution you want (assuming the video'card supports the desired resolution). '------------------------------------------------------------'Comments : Global Declarations for ChangeScreenResolution'------------------------------------------------------------Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" _(ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As BooleanPrivate Declare Function ChangeDisplaySettings Lib "user32" Alias "ChangeDisplaySettingsA" _(lpDevMode As Any, ByVal dwFlags As Long) As LongConst CCDEVICENAME = 32Const CCFORMNAME = 32Const DM_PELSWIDTH = &H80000Const DM_PELSHEIGHT = &H100000Private 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 LongEnd TypeDim DevM As DEVMODE'------------------------------------------------------------'Comments : Allows changing of screen resolution in Win95' Example: Call ChangeScreenResolution(800,600)'Parameters: iWidth, iheight: integer values of resolution'Sets : Requested screen resolution or if screen is' already at resolution returns true'Returns : None'Created by: Bridgett M. Cole, Saltware Computer Services'Created : 12/1/97 8:15:58 PM'------------------------------------------------------------Public Sub ChangeScreenResolution(iWidth As Single, iHeight As Single) Dim A As Boolean Dim I& Dim B& I = 0 Do A = EnumDisplaySettings(0&, I&, DevM) I = I + 1 Loop Until (A = False) DevM.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHT DevM.dmPelsWidth = iWidth DevM.dmPelsHeight = iHeight B = ChangeDisplaySettings(DevM, 0)End Subgruß heino

geschrieben von




Beitrag anfügen