全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1571
推到 Plurk!
推到 Facebook!

如何變更:子螢幕的解析度

缺席
HikaruGo
中階會員


發表:22
回覆:69
積分:88
註冊:2007-12-09

發送簡訊給我
#1 引用回覆 回覆 發表時間:2009-06-12 13:59:40 IP:61.62.xxx.xxx 訂閱
如何變更
子螢幕的解析度

[code delphi]
var DeviceMode:TDeviceMode;
ii:integer;
begin
ii := Screen.MonitorCount;// ii=2
DeviceMode.dmSize := SizeOf(TDeviceMode);
DeviceMode.dmPelsWidth := 1280;
DeviceMode.dmPelsHeight := 800;
//DeviceMode.dmOrientation := 2;
DeviceMode.dmDeviceName := '\\.\DISPLAY2';
DeviceMode.dmFields := DM_ORIENTATION or DM_PELSWIDTH or DM_PELSHEIGHT;
caption := inttostr(ChangeDisplaySettings(DeviceMode,CDS_UPDATEREGISTRY) );



[/code]


相關API
The EnumDisplaySettings function obtains information about one of a display device's graphics modes. You can obtain information for all of a display device's graphics modes by making a series of calls to this function.
BOOL EnumDisplaySettings(
LPCTSTR lpszDeviceName, // specifies the display device
DWORD iModeNum, // specifies the graphics mode
LPDEVMODE lpDevMode // points to structure to receive settings
);

Parameters
lpszDeviceName
Pointer to a null-terminated string that specifies the display device whose graphics mode the function will obtain information about.
This parameter can be NULL. A NULL value specifies the current display device on the computer that the calling thread is running on.
If lpszDeviceName is not NULL, the string must be of the form \\.\DisplayX, where X can have the values 1, 2, or 3.



目前只會改變 主螢幕,無法變更子螢幕(延伸螢幕)
引用 ChangeDisplaySettingsEx即可
編輯記錄
HikaruGo 重新編輯於 2009-06-17 11:19:09, 註解 無‧
系統時間:2017-12-13 15:27:15
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!