function Resolution(X,Y:word):boolean;<br>var<br> DevMode:TDeviceMode;<br> begin<br> Result:=EnumDisplaySettings(nil,0,DevMode);<br> if Result then<br> begin<br> DevMode.dmFields:=DM_PELSWIDTH Or DM_PELSHEIGHT;<br> DevMode.dmPelsWidth:=X;<br> DevMode.dmPelsHeight:=Y;<br> Result:=ChangeDisplaySettings(DevMode,0)=DISP_CHANGE_SUCCESSFUL;<br> end;<br> end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> if Resolution(800,600) then ShowMessage('800×600模式!');<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> if Resolution(1280,1024) then ShowMessage('1280X1024模式!');<br>end;<br><br>procedure TForm1.Button3Click(Sender: TObject);<br>begin<br> if Resolution(1024,768) then ShowMessage('1024X768模式!');<br>end;<br><br>自己改改了。