部分代码
var
  Form1: TForm1;
  xx,yy:integer;
  lpMode:TDeviceMode;
  function DynamicResolution(x,y: word):BooL;
implementation{$R *.dfm}
function DynamicResolution(x,y: word):BooL;
var
lpDevMode:TDeviceMode;
begin
Result:=EnumDisplaySettings(nil,0,lpDevmode);
if Result then
begin
lpDevMode.dmFields:=DM_PELSWIDTH Or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth :=x;
lpDevMode.dmPelsHeight :=y;
Result := ChangeDisplaySettings(lpDevMode, 0) = DISP_CHANGE_SUCCESSFUL;
end;
end;procedure TForm1.Button1Click(Sender: TObject);
begin
  if DynamicResolution(1024, 768) then
     ShowMessage('Now is 1024*768');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
if (lpMode.dmPelsWidth<>800)and(lpMode.dmPelsHeight<>600) then
  DynamicResolution(800,600);
end;请问怎么解决这个问题?