Can Anyone tell me how to change screen resolution on
Form.Create Event .I want to make my application to change the resolution OnCreate and restore the previous resolution OnClose
Thanks
As aaronjme points out, this is probably not a good idea, but this might work (I don't know if it's intended for win9x or winnt or both).
ripped off from google newsgroups:
function NewRes(XRes,YResWord):integer;
var
DevMode:TDeviceMode;
begin
EnumDisplaySettings(nil, 0, DevMode);
DevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
DevMode.dmPelsWidth:=XRes;
DevMode.dmPelsHeight:=YRes;
Result:=ChangeDisplaySettings(DevMode, 0);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if NewRes(1024,768)=DISP_CHANGE_SUCCESSFUL then
begin
ShowMessage('Resolution changed.');
end;
end;
Brian
"There are 2 kinds of people in the world, those that divide people into two groups and those that don't. I belong to the second group." - tag line I stole
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.