From: Davie Reed Subject: Re: Change windows resolution at work time Date: 04 Feb 1999 00:00:00 GMT Message-ID: <36B9A054.F3C31317@smatters.com> Content-Transfer-Encoding: 8bit References: <36B9FCD2.4DED4524@pulso.com> X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.delphi.graphics Yes, it's no big deal. Just make sure the USER really wants to do this. Also, at the same time you can change the screen's color depth (bpp). Here's a small snipet for you to play with :) Davie =================== sample code ==================== Function VideoSwitch(Bits:Word):Integer; Var DevMode:TDevMode; DevModePtr:^TDevMode; Begin If Bits<>0 Then Begin DevMode.dmSize:=SizeOf(DevMode); DevMode.dmFields:=dm_BitsPerPel; DevMode.dmBitsPerPel:=Bits; DevMode.dmDriverExtra:=0; VideoSwitch:=ChangeDisplaySettings(DevMode,0); End Else Begin DevModePtr:=Nil; VideoSwitch:=ChangeDisplaySettings(DevModePtr^,0); End; End; Example uses: VideoSwitch(0); Switches back to the way the system had booted up in VideoSwitch(8); Switches to 8bit mode (256 color) good VideoSwitch(16); Switches to 16 bit mode (HI-COLOR) better VideoSwitch(24); Switches to 24 bit mode (TRUE-COLOR) best Example of checking to see if the videoswitch actually worked :) If VideoSwitch(24)<>DISP_CHANGE_SUCCESSFUL Then VideoSwitch(16); ================================================== Pablo Carmona wrote: > Itīs posible to make a program that puts windows at 640x480 and at the > end of it recover the original screen resolution? > > Thanks in advance