4
我希望能夠在Windows Vista中使用C#啓用輔助監視器。這是我做的:以編程方式啓用輔助監視器
SafeNativeMethods.EnumDisplayDevices(null, (uint)id, ref d, (uint)0);
...
SafeNativeMethods.EnumDisplaySettings(d.DeviceName, -2, ref mode0);
...
SafeNativeMethods.DEVMODE dm = mode0;
dm.dmPosition.x = 1440;
dm.dmFields = SafeNativeMethods.DM_POSITION;
long result = SafeNativeMethods.ChangeDisplaySettingsEx(d.DeviceName, ref dm, IntPtr.Zero, SafeNativeMethods.CDS_NORESET| SafeNativeMethods.CDS_UPDATEREGISTRY, IntPtr.Zero);
result = SafeNativeMethods.ChangeDisplaySettingsEx(null, ref dm, IntPtr.Zero, SafeNativeMethods.CDS_UPDATEREGISTRY, IntPtr.Zero);
這不會影響我的第二個顯示器,即使我得到0的結果(這意味着成功的)。
我做錯了什麼?
謝謝。