Y
ylmboy
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大虾,我在程序中用以下代码对显示分辨率进行调整时,出现以下问题:<br> a 从600*480(系统原有分辨率)改成800*600后,windows状态栏没有随之<br> 移动,在屏幕中间显示。<br> b 同理800*600改成600*480后,windows状态栏无法找到。<br> 不知如何解决?<br><br> function TForm1.DynamicResolution(X, Y: word): BOOL;<br>var<br>lpDevMode: TDeviceMode;<br>begin<br>Result := EnumDisplaySettings(nil, 0, lpDevMode);<br>if Result then<br>begin<br>lpDevMode.dmFields := DM_PELSWIDTH Or DM_PELSHEIGHT;<br>lpDevMode.dmPelsWidth := X;<br>lpDevMode.dmPelsHeight := Y;<br>Result := ChangeDisplaySettings(lpDevMode, 0) = DISP_CHANGE_SUCCESSFUL;<br> end<br> end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>if DynamicResolution(640, 480) then<br>ShowMessage('Now is 640*480');<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br>if DynamicResolution(800, 600) then<br>ShowMessage('Now is 800*600');<br>end;<br>