En  Fa
softprojects.org
Discovering: Tips & Tricks  > Languages  > Delphi Tips  > How to change monitor resolution in Delphi
 

Articles

 

 

Tips and Tricks

 


 

How to change monitor resolution in Delphi

Print version  

How to change monitor resolution in Delphi

Description

This method change screen resolution using windows API.

Delphi code

procedure SetResolution(ResX, ResY: DWord);
var
    lDeviceMode : TDeviceMode;
begin
    EnumDisplaySettings(nil, 0, lDeviceMode);
    lDeviceMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
    lDeviceMode.dmPelsWidth :=ResX;
    lDeviceMode.dmPelsHeight:=ResY;
    ChangeDisplaySettings(lDeviceMode, 0);
end;

Important:

Your monitor may damage if the entered values be incorrect. Use standard sizes.

Details
      
Writer: Salar Khalilzadeh
Date Sent: 3/16/2008 7:35 AM
Views: 258
Votes: 0
Rating: Not Rated from Not Rated

Your Rating:
bookmark this
 

There is no comment for this topic.

Language:

Copyright © 2008 SoftProjects.org | About | Valid XHTML | CSS