Changing Windows Resolution Using Delphi
Some might be wondering how people write massive programs. Well.. Most of the time, it's not just about the skills of the programmer, But also the features of the OS and the development language + tools. Well.. If you ever wanted to write a small program to change the screen resolution of your windows machine but you failed, you may be wondering about what i'm gonna say... Actually, with delphi, changing the resolution of your computer is just few lines of code.. Even if you are a stranger to delphi, you may be able to easily get the program working. You want to see the code??? Ok, here it is.
var
lpDevMode : TDeviceMode;
begin
EnumDisplaySettings(nil, 0, lpDevMode);
lpDevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth:=XRes;
lpDevMode.dmPelsHeight:=YRes;
ChangeDisplaySettings(lpDevMode, CDS_UPDATEREGISTRY );
end;
Just try it yourself.
Anyway, i've uploded a sample project along with the application. Just have a look.
Have Fun!
/Cheers,
-MadGuy
var
lpDevMode : TDeviceMode;
begin
EnumDisplaySettings(nil, 0, lpDevMode);
lpDevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth:=XRes;
lpDevMode.dmPelsHeight:=YRes;
ChangeDisplaySettings(lpDevMode, CDS_UPDATEREGISTRY );
end;
Just try it yourself.
Anyway, i've uploded a sample project along with the application. Just have a look.
| http://rapidshare.de/files/14482738/Resolution_Changer.zip.html |
Have Fun!
/Cheers,
-MadGuy

0 Comments:
Post a Comment
Links to this post:
Create a Link
<< Home