| Change the resolution of your screen.
Actually I've ever used this function for TV-based software development, because of TV-resolution.
{
The function NewRes can have the following result:
DISP_CHANGE_SUCCESSFUL The settings change was successful.
DISP_CHANGE_RESTART The computer must be restarted in order for the graphics mode to work.
DISP_CHANGE_BADFLAGS An invalid set of flags was passed in.
DISP_CHANGE_FAILED The display driver failed the specified graphics mode.
DISP_CHANGE_BADMODE The graphics mode is not supported.
DISP_CHANGE_NOTUPDATED Windows NT only: Unable to write settings to the registry.
}
function NewRes(XRes,YRes:DWord):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;
|