//改变分辨率的函数。
{function Resolution(X,Y:word):boolean;
var
DevMode:TDeviceMode;
begin
Result:=EnumDisplaySettings(nil,0,DevMode);
if Result then
begin
DevMode.dmFields:=DM_PELSWIDTH Or DM_PELSHEIGHT;
DevMode.dmPelsWidth:=X;
DevMode.dmPelsHeight:=Y;
Result:=ChangeDisplaySettings(DevMode,0)=DISP_CHANGE_SUCCESSFUL;
end;
end; }
// 禁止改变窗体大小
{procedure WMGetMinMaxInfo(var Msg: TWMGetMinMaxInfo;Sender:TObject); //enable change form size
begin
inherited;
with Msg.MinMaxInfo^ do begin
ptMinTrackSize.x:= TForm(Sender).width;
ptMaxTrackSize.x:= TForm(Sender).width;
ptMinTrackSize.y:= TForm(Sender).height;
ptMaxTrackSize.y:= TForm(Sender).height;
end;
end; }
//退出时恢复以前设定(分辨率):
{procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
var
x:longint;
y:longint;
a:string;
b:string;
begin
x:=getsystemmetrics(sm_cxscreen);
str(x,a);
y:=getsystemmetrics(sm_cyscreen);
str(y,b);
begin
Resolution(strtoint(a),strtoint(b));
end;
end;
}