C
crazycock
Unregistered / Unconfirmed
GUEST, unregistred user!
显卡有双头,可以在第二个头显示屏幕2的内容。程序里面需要控制屏幕2的分辨率,从桌面-属性-设置-屏幕分辨率里可以手工设置。<br><br>我的代码:<br>function ChgDisplaySetting():Boolean;<br>var<br> DevMode:TDeviceMode;<br> dd:TDisplayDevice;<br> ScreenNo:Integer;<br> ret:Boolean;<br>begin<br>// ScreenNo:=0;<br>// repeat<br>// ZeroMemory(@dd,SizeOf(TDisplayDevice));<br>// dd.cb := SizeOf(TDisplayDevice);<br>// ret := EnumDisplayDevices(nil,ScreenNo,dd,0);<br>// Form1.Memo1.Lines.Add(dd.DeviceName);<br>// Form1.Memo1.Lines.Add(dd.DeviceString);<br>// Form1.Memo1.Lines.Add('--------------------');<br>// Inc(ScreenNo);<br>// until not ret;<br><br> ScreenNo:=1;<br> ZeroMemory(@dd,SizeOf(TDisplayDevice));<br> dd.cb := SizeOf(TDisplayDevice);<br> ret := EnumDisplayDevices(nil,ScreenNo,dd,0);<br><br> ZeroMemory(@DevMode,Sizeof(TDeviceMode));<br> DevMode.dmSize := Sizeof(TDeviceMode);<br> Result := EnumDisplaySettings(dd.DeviceName,4294967295-1,DevMode);<br> if Result then<br> begin <br> DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or DM_DISPLAYFLAGS;<br> DevMode.dmPelsWidth := 800;<br> DevMode.dmPelsHeight := 600;<br> StrPCopy(DevMode.dmDeviceName,dd.DeviceName);<br> Result := ChangeDisplaySettingsEx(dd.DeviceName,DevMode,0,CDS_NORESET or CDS_UPDATEREGISTRY,0)=DISP_CHANGE_SUCCESSFUL;<br> //ChangeDisplaySettings(DevMode,0);<br> end;<br>end;<br><br>代码不管怎么改,修改的总是第一块屏幕的分辨率,不知道哪个地方没写对。希望大家指点一下。