Dynamic changing screen settings

zhaozj2021-02-11  211

Dynamic Change Screen Settings We often see many Win95 applications (especially games) change the settings of the screen while running it, recover after running, in VB, we can implement the following methods: Underline in the text (_) To connect a line.

Defined 'Vb man 2001'URL: http://goodvbman.yeah.net' E-mail: coolde@21cn.comPrivate Declare Function lstrcpy _Lib "kernel32" Alias ​​"lstrcpyA" _ (lpString1 As Any, lpString2 As Any) _As LongConst CCHDEVICENAME = 32Const CCHFORMNAME = 32Private Type DEVMODEdmDeviceName As String * CCHDEVICENAMEdmSpecVersion As IntegerdmDriverVersion As IntegerdmSize As IntegerdmDriverExtra As IntegerdmFields As LongdmOrientation As IntegerdmPaperSize As IntegerdmPaperLength As IntegerdmPaperWidth As IntegerdmScale As IntegerdmCopies As IntegerdmDefaultSource As IntegerdmPrintQuality As IntegerdmColor As IntegerdmDuplex As IntegerdmYResolution As IntegerdmTTOption As IntegerdmCollate As IntegerdmFormName As String * CCHFORMNAMEdmUnusedPadding As IntegerdmBitsPerPel As IntegerdmPelsWidth As LongdmPelsHeight As LongdmDisplayFlags As LongdmDisplayFrequency As LongEnd TypePrivate Declare Function _ChangeDisplaySettings Lib _ "User32" Alias ​​"ChangeDisplaySettingsA" (_ByVal lpDevMode As Long, _ByVal dwflags As Long) As Long function 'Vb man 2001'URL: http://goodvbman.yeah.net' E-mail: coolde@21cn.comPublic Function SetDisplayMode (Width As _Integer, Height As Integer, Color As _Integer) As LongConst DM_PELSWIDTH = & H80000Const DM_PELSHEIGHT = & H100000Const DM_BITSPERPEL = & H40000Dim NewDevMode As DEVMODEDim pDevmode As LongWith NewDevMode.dmSize = 122If Color = -1 Then.dmFields = DM_PELSWIDTH Or DM_PELSHEIGHTElse.dmFields = DM_PELSWIDTH Or _DM_PELSHEIGHT Or DM_BITSPERPELEnd If.dmPelsWidth = Width.dmPelsHeight = Height If Color <> -1 Then .dmbitsperpel = color negative withpdevmode =

转载请注明原文地址:https://www.9cbs.com/read-4873.html

New Post(0)