Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Display Control - Switch Monitors

If you have a question or need help, this is the place to be.
Post Reply
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Display Control - Switch Monitors

Post by Quantus »

I have a digital flat panel and an LCD projector connected to my NVidia 6600gt video card, and I prefer to use the VMR9 renderer. Due to limitations with the NVidia hardware/drivers, VMR9 will only operate properly on the primary monitor. I accommodate this limitation by manually switching the active monitor when I wish to watch a video.

My question is this: how would I go about using EG to switch the monitors, and, hopefully, obtain display information? I don't mind writing a bit of code, but I don't really know where to start. I am assuming that I have to somehow query the NVidia driver, but I don't know how to do that.

Suggestions?
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

Well, some more advanced control for multi-monitor-setups has already been requested. I might get to this topic in the nearer future.

The basis of such control is the Win32 function ChangeDisplaySettingsEx and the DEVMODE structure.

http://msdn.microsoft.com/library/defau ... s_3tfc.asp
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

Ok, we have a new action in the beta 774: "Set Display Preset" under System/Display.

It is really easy to configure:
1. Setup your displays with the normal "Display Properties" dialog of Windows.
2. If everything is like you need, add a "Set Display Preset" action and press "Query current display settings". You will see some info in the list, but there is nothing more you can edit.
3. Repeat steps 1. and 2. for as many setups you might want to use.

Every action should now revert the display settings to the state that you have queried and saved. Properties like which display is where, which is primary, which is attached or detached, resolution and such should go exactly to the saved state.

I hope this action will be sufficient for your purpose. It is fresh out of the oven, so let's see if it has any bad side-effects.
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus »

Interresting.

Will test.
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus »

Very neat. Unfortunately...

The script recognises the settings for the primary and secondary monitor, but does not regognise which[\b] monitor is secondary and which is primary.

For example:
Monitor = DFP 1280 x 1024
Projector = LCD 1280 x 720

Set Monitor=primary, projector off
Create new macro, Query current settings, save macro as "monitor only"

Set Monitor=off, Projector=primary
Create new macro, query current settings, save macro as "projector only"

With Monitor=primary, projector=off, Execute macro: projector only.
Result=monitor (DFP) resized to 1280x720

In other words, the settings do not recognise which device is assigned to display 1, and which device is assigned to display 2. Or, if I understand things correctly, Display 1 is always[\b] primary.

I get a similar effect when I use both monitors at the same time (NVidia Dual View). No matter which I set as primary in windows, EG always sees it as Display 1.

I spent some time looking at the win32api module for Python, and I am not sure that it is even possible to "switch" between monitors using Python, without some other helper app. Perhaps the ctypes library would make this possible.

It seems to me that we need "EnumDisplayDevices," and that is not implemented in the Python win32api library.
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

The device name should be consistent for one head of the card, no matter if it is the primary or not. So the name only indicates which output you mean. The order of the lines is also of no significance.

Could you please paste your two macros here, so I can see what settings have been enumerated?

The action already uses ctypes and EnumDisplayDevices.
Without ctypes we wouldn't have come far. :)
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

I have just uploaded 775 that should help to track this down.
Everytime you press the query button, you will get a lengthy output in the logger.

So please do this:
1. Right-click in the logger and select "clear all"
2. Open up a "Set Display Preset" action, press the query button and cancel the dialog.
3. Select all lines in the logger and copy them. You can use shift-click to select multiple lines.
4. Paste the stuff here between

Code: Select all

 tags.

Please do this for your three setups:
A. Only DFP activated
B. Only projector activated
C. Both activated
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus »

DFP Only

Code: Select all

11:20:57 PM DISPLAY_DEVICE(
11:20:57 PM     cb = 424L,
11:20:57 PM     DeviceName = '\\\\.\\DISPLAY1',
11:20:57 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
11:20:57 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_MODESPRUNED | DISPLAY_DEVICE_PRIMARY_DEVICE,
11:20:57 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
11:20:57 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{33FFA2B9-2D8D-423D-B546-9BF8A0D7FD70}\\0000',
11:20:57 PM )
11:20:57 PM DEVMODE(
11:20:57 PM     dmDeviceName = '',
11:20:57 PM     dmSpecVersion = 1025,
11:20:57 PM     dmDriverVersion = 1025,
11:20:57 PM     dmSize = 124,
11:20:57 PM     dmDriverExtra = 0,
11:20:57 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
11:20:57 PM     union1 = _U1(
11:20:57 PM         printer = _U1A(
11:20:57 PM             dmOrientation = 0,
11:20:57 PM             dmPaperSize = 0,
11:20:57 PM             dmPaperLength = 0,
11:20:57 PM             dmPaperWidth = 0,
11:20:57 PM             dmScale = 0,
11:20:57 PM             dmCopies = 0,
11:20:57 PM             dmDefaultSource = 0,
11:20:57 PM             dmPrintQuality = 0,
11:20:57 PM         ),
11:20:57 PM         dmPosition = _U1B(
11:20:57 PM             x = 0,
11:20:57 PM             y = 0,
11:20:57 PM         ),
11:20:57 PM     ),
11:20:57 PM     dmColor = 0,
11:20:57 PM     dmDuplex = 0,
11:20:57 PM     dmYResolution = 0,
11:20:57 PM     dmTTOption = 0,
11:20:57 PM     dmCollate = 0,
11:20:57 PM     dmFormName = '',
11:20:57 PM     dmLogPixels = 0,
11:20:57 PM     dmBitsPerPel = 32L,
11:20:57 PM     dmPelsWidth = 1280L,
11:20:57 PM     dmPelsHeight = 1024L,
11:20:57 PM     dmDisplayFlags = 0L,
11:20:57 PM     dmDisplayFrequency = 60L,
11:20:57 PM     dmDriverExtraData = '',
11:20:57 PM )
11:20:57 PM DISPLAY_DEVICE(
11:20:57 PM     cb = 424L,
11:20:57 PM     DeviceName = '\\\\.\\DISPLAY2',
11:20:57 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
11:20:57 PM     StateFlags = ,
11:20:57 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
11:20:57 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{33FFA2B9-2D8D-423D-B546-9BF8A0D7FD70}\\0001',
11:20:57 PM )
11:20:57 PM DEVMODE(
11:20:57 PM     dmDeviceName = '',
11:20:57 PM     dmSpecVersion = 1025,
11:20:57 PM     dmDriverVersion = 1025,
11:20:57 PM     dmSize = 124,
11:20:57 PM     dmDriverExtra = 0,
11:20:57 PM     dmFields = DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
11:20:57 PM     union1 = _U1(
11:20:57 PM         printer = _U1A(
11:20:57 PM             dmOrientation = 1280,
11:20:57 PM             dmPaperSize = 0,
11:20:57 PM             dmPaperLength = 0,
11:20:57 PM             dmPaperWidth = 0,
11:20:57 PM             dmScale = 0,
11:20:57 PM             dmCopies = 0,
11:20:57 PM             dmDefaultSource = 0,
11:20:57 PM             dmPrintQuality = 0,
11:20:57 PM         ),
11:20:57 PM         dmPosition = _U1B(
11:20:57 PM             x = 1280,
11:20:57 PM             y = 0,
11:20:57 PM         ),
11:20:57 PM     ),
11:20:57 PM     dmColor = 0,
11:20:57 PM     dmDuplex = 0,
11:20:57 PM     dmYResolution = 0,
11:20:57 PM     dmTTOption = 0,
11:20:57 PM     dmCollate = 0,
11:20:57 PM     dmFormName = '',
11:20:57 PM     dmLogPixels = 0,
11:20:57 PM     dmBitsPerPel = 32L,
11:20:57 PM     dmPelsWidth = 1920L,
11:20:57 PM     dmPelsHeight = 1080L,
11:20:57 PM     dmDisplayFlags = 0L,
11:20:57 PM     dmDisplayFrequency = 60L,
11:20:57 PM     dmDriverExtraData = '',
11:20:57 PM )
11:20:57 PM DISPLAY_DEVICE(
11:20:57 PM     cb = 424L,
11:20:57 PM     DeviceName = '\\\\.\\DISPLAYV1',
11:20:57 PM     DeviceString = 'NetMeeting driver',
11:20:57 PM     StateFlags = DISPLAY_DEVICE_MIRRORING_DRIVER,
11:20:57 PM     DeviceID = '',
11:20:57 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{8B6D7859-A639-4A15-8790-7161976D057A}\\0000',
11:20:57 PM )
11:20:57 PM DISPLAY_DEVICE(
11:20:57 PM     cb = 424L,
11:20:57 PM     DeviceName = '\\\\.\\DISPLAYV2',
11:20:57 PM     DeviceString = 'RDPDD Chained DD',
11:20:57 PM     StateFlags = DISPLAY_DEVICE_MIRRORING_DRIVER,
11:20:57 PM     DeviceID = '',
11:20:57 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{DEB039CC-B704-4F53-B43E-9DD4432FA2E9}\\0000',
11:20:57 PM )
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus »

Projector Only

Code: Select all

11:24:34 PM DISPLAY_DEVICE(
11:24:34 PM     cb = 424L,
11:24:34 PM     DeviceName = '\\\\.\\DISPLAY1',
11:24:34 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
11:24:34 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE,
11:24:34 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
11:24:34 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{33FFA2B9-2D8D-423D-B546-9BF8A0D7FD70}\\0000',
11:24:34 PM )
11:24:34 PM DEVMODE(
11:24:34 PM     dmDeviceName = '',
11:24:34 PM     dmSpecVersion = 1025,
11:24:34 PM     dmDriverVersion = 1025,
11:24:34 PM     dmSize = 124,
11:24:34 PM     dmDriverExtra = 0,
11:24:34 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
11:24:34 PM     union1 = _U1(
11:24:34 PM         printer = _U1A(
11:24:34 PM             dmOrientation = 0,
11:24:34 PM             dmPaperSize = 0,
11:24:34 PM             dmPaperLength = 0,
11:24:34 PM             dmPaperWidth = 0,
11:24:34 PM             dmScale = 0,
11:24:34 PM             dmCopies = 0,
11:24:34 PM             dmDefaultSource = 0,
11:24:34 PM             dmPrintQuality = 0,
11:24:34 PM         ),
11:24:34 PM         dmPosition = _U1B(
11:24:34 PM             x = 0,
11:24:34 PM             y = 0,
11:24:34 PM         ),
11:24:34 PM     ),
11:24:34 PM     dmColor = 0,
11:24:34 PM     dmDuplex = 0,
11:24:34 PM     dmYResolution = 0,
11:24:34 PM     dmTTOption = 0,
11:24:34 PM     dmCollate = 0,
11:24:34 PM     dmFormName = '',
11:24:34 PM     dmLogPixels = 0,
11:24:34 PM     dmBitsPerPel = 32L,
11:24:34 PM     dmPelsWidth = 1280L,
11:24:34 PM     dmPelsHeight = 720L,
11:24:34 PM     dmDisplayFlags = 0L,
11:24:34 PM     dmDisplayFrequency = 60L,
11:24:34 PM     dmDriverExtraData = '',
11:24:34 PM )
11:24:34 PM DISPLAY_DEVICE(
11:24:34 PM     cb = 424L,
11:24:34 PM     DeviceName = '\\\\.\\DISPLAY2',
11:24:34 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
11:24:34 PM     StateFlags = ,
11:24:34 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
11:24:34 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{33FFA2B9-2D8D-423D-B546-9BF8A0D7FD70}\\0001',
11:24:34 PM )
11:24:34 PM DEVMODE(
11:24:34 PM     dmDeviceName = '',
11:24:34 PM     dmSpecVersion = 1025,
11:24:34 PM     dmDriverVersion = 1025,
11:24:34 PM     dmSize = 124,
11:24:34 PM     dmDriverExtra = 0,
11:24:34 PM     dmFields = DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
11:24:34 PM     union1 = _U1(
11:24:34 PM         printer = _U1A(
11:24:34 PM             dmOrientation = 1280,
11:24:34 PM             dmPaperSize = 0,
11:24:34 PM             dmPaperLength = 0,
11:24:34 PM             dmPaperWidth = 0,
11:24:34 PM             dmScale = 0,
11:24:34 PM             dmCopies = 0,
11:24:34 PM             dmDefaultSource = 0,
11:24:34 PM             dmPrintQuality = 0,
11:24:34 PM         ),
11:24:34 PM         dmPosition = _U1B(
11:24:34 PM             x = 1280,
11:24:34 PM             y = 0,
11:24:34 PM         ),
11:24:34 PM     ),
11:24:34 PM     dmColor = 0,
11:24:34 PM     dmDuplex = 0,
11:24:34 PM     dmYResolution = 0,
11:24:34 PM     dmTTOption = 0,
11:24:34 PM     dmCollate = 0,
11:24:34 PM     dmFormName = '',
11:24:34 PM     dmLogPixels = 0,
11:24:34 PM     dmBitsPerPel = 32L,
11:24:34 PM     dmPelsWidth = 1920L,
11:24:34 PM     dmPelsHeight = 1080L,
11:24:34 PM     dmDisplayFlags = 0L,
11:24:34 PM     dmDisplayFrequency = 60L,
11:24:34 PM     dmDriverExtraData = '',
11:24:34 PM )
11:24:34 PM DISPLAY_DEVICE(
11:24:34 PM     cb = 424L,
11:24:34 PM     DeviceName = '\\\\.\\DISPLAYV1',
11:24:34 PM     DeviceString = 'NetMeeting driver',
11:24:34 PM     StateFlags = DISPLAY_DEVICE_MIRRORING_DRIVER,
11:24:34 PM     DeviceID = '',
11:24:34 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{8B6D7859-A639-4A15-8790-7161976D057A}\\0000',
11:24:34 PM )
11:24:34 PM DISPLAY_DEVICE(
11:24:34 PM     cb = 424L,
11:24:34 PM     DeviceName = '\\\\.\\DISPLAYV2',
11:24:34 PM     DeviceString = 'RDPDD Chained DD',
11:24:34 PM     StateFlags = DISPLAY_DEVICE_MIRRORING_DRIVER,
11:24:34 PM     DeviceID = '',
11:24:34 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{DEB039CC-B704-4F53-B43E-9DD4432FA2E9}\\0000',
11:24:34 PM )
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus »

DFP (primary) + Projector

Code: Select all

11:27:29 PM DISPLAY_DEVICE(
11:27:29 PM     cb = 424L,
11:27:29 PM     DeviceName = '\\\\.\\DISPLAY1',
11:27:29 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
11:27:29 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_MODESPRUNED | DISPLAY_DEVICE_PRIMARY_DEVICE,
11:27:29 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
11:27:29 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{33FFA2B9-2D8D-423D-B546-9BF8A0D7FD70}\\0000',
11:27:29 PM )
11:27:29 PM DEVMODE(
11:27:29 PM     dmDeviceName = '',
11:27:29 PM     dmSpecVersion = 1025,
11:27:29 PM     dmDriverVersion = 1025,
11:27:29 PM     dmSize = 124,
11:27:29 PM     dmDriverExtra = 0,
11:27:29 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
11:27:29 PM     union1 = _U1(
11:27:29 PM         printer = _U1A(
11:27:29 PM             dmOrientation = 0,
11:27:29 PM             dmPaperSize = 0,
11:27:29 PM             dmPaperLength = 0,
11:27:29 PM             dmPaperWidth = 0,
11:27:29 PM             dmScale = 0,
11:27:29 PM             dmCopies = 0,
11:27:29 PM             dmDefaultSource = 0,
11:27:29 PM             dmPrintQuality = 0,
11:27:29 PM         ),
11:27:29 PM         dmPosition = _U1B(
11:27:29 PM             x = 0,
11:27:29 PM             y = 0,
11:27:29 PM         ),
11:27:29 PM     ),
11:27:29 PM     dmColor = 0,
11:27:29 PM     dmDuplex = 0,
11:27:29 PM     dmYResolution = 0,
11:27:29 PM     dmTTOption = 0,
11:27:29 PM     dmCollate = 0,
11:27:29 PM     dmFormName = '',
11:27:29 PM     dmLogPixels = 0,
11:27:29 PM     dmBitsPerPel = 32L,
11:27:29 PM     dmPelsWidth = 1280L,
11:27:29 PM     dmPelsHeight = 1024L,
11:27:29 PM     dmDisplayFlags = 0L,
11:27:29 PM     dmDisplayFrequency = 60L,
11:27:29 PM     dmDriverExtraData = '',
11:27:29 PM )
11:27:29 PM DISPLAY_DEVICE(
11:27:29 PM     cb = 424L,
11:27:29 PM     DeviceName = '\\\\.\\DISPLAY2',
11:27:29 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
11:27:29 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP,
11:27:29 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
11:27:29 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{33FFA2B9-2D8D-423D-B546-9BF8A0D7FD70}\\0001',
11:27:29 PM )
11:27:29 PM DEVMODE(
11:27:29 PM     dmDeviceName = '',
11:27:29 PM     dmSpecVersion = 1025,
11:27:29 PM     dmDriverVersion = 1025,
11:27:29 PM     dmSize = 124,
11:27:29 PM     dmDriverExtra = 0,
11:27:29 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
11:27:29 PM     union1 = _U1(
11:27:29 PM         printer = _U1A(
11:27:29 PM             dmOrientation = 1280,
11:27:29 PM             dmPaperSize = 0,
11:27:29 PM             dmPaperLength = 0,
11:27:29 PM             dmPaperWidth = 0,
11:27:29 PM             dmScale = 0,
11:27:29 PM             dmCopies = 0,
11:27:29 PM             dmDefaultSource = 0,
11:27:29 PM             dmPrintQuality = 0,
11:27:29 PM         ),
11:27:29 PM         dmPosition = _U1B(
11:27:29 PM             x = 1280,
11:27:29 PM             y = 0,
11:27:29 PM         ),
11:27:29 PM     ),
11:27:29 PM     dmColor = 0,
11:27:29 PM     dmDuplex = 0,
11:27:29 PM     dmYResolution = 0,
11:27:29 PM     dmTTOption = 0,
11:27:29 PM     dmCollate = 0,
11:27:29 PM     dmFormName = '',
11:27:29 PM     dmLogPixels = 0,
11:27:29 PM     dmBitsPerPel = 32L,
11:27:29 PM     dmPelsWidth = 1280L,
11:27:29 PM     dmPelsHeight = 720L,
11:27:29 PM     dmDisplayFlags = 0L,
11:27:29 PM     dmDisplayFrequency = 60L,
11:27:29 PM     dmDriverExtraData = '',
11:27:29 PM )
11:27:29 PM DISPLAY_DEVICE(
11:27:29 PM     cb = 424L,
11:27:29 PM     DeviceName = '\\\\.\\DISPLAYV1',
11:27:29 PM     DeviceString = 'NetMeeting driver',
11:27:29 PM     StateFlags = DISPLAY_DEVICE_MIRRORING_DRIVER,
11:27:29 PM     DeviceID = '',
11:27:29 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{8B6D7859-A639-4A15-8790-7161976D057A}\\0000',
11:27:29 PM )
11:27:29 PM DISPLAY_DEVICE(
11:27:29 PM     cb = 424L,
11:27:29 PM     DeviceName = '\\\\.\\DISPLAYV2',
11:27:29 PM     DeviceString = 'RDPDD Chained DD',
11:27:29 PM     StateFlags = DISPLAY_DEVICE_MIRRORING_DRIVER,
11:27:29 PM     DeviceID = '',
11:27:29 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{DEB039CC-B704-4F53-B43E-9DD4432FA2E9}\\0000',
11:27:29 PM )
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Post by Bitmonster »

Shit, this is hard. The NVidia driver seems to actually swapping the displays. Even the registry keys seem to swap. Do you activate/swap them in the NVidia control panel or in the normal Windows dialog?

On my workstation I have an older NVidia GF2MX with dual-head and there everything works the way it should.
Quantus
Plugin Developer
Posts: 17
Joined: Thu Sep 21, 2006 1:57 pm

Post by Quantus »

Um... sorry. I used the NVidia control panel to switch the displays (I know that you told me to use the normal display properties dialog in Windows, but it was late and I had a brain cramp when I was testing this).

The result is different when using the windows display properties to change the display devices. See below (I trimmed the data a little):

DFP Only

Code: Select all

3:48:22 PM DISPLAY_DEVICE(
3:48:22 PM     cb = 424L,
3:48:22 PM     DeviceName = '\\\\.\\DISPLAY1',
3:48:22 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
3:48:22 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_MODESPRUNED | DISPLAY_DEVICE_PRIMARY_DEVICE,
3:48:22 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
3:48:22 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{15EB21EC-828F-4DE7-BDB7-673C069D78AA}\\0000',
3:48:22 PM )
3:48:22 PM DEVMODE(
3:48:22 PM     dmDeviceName = '',
3:48:22 PM     dmSpecVersion = 1025,
3:48:22 PM     dmDriverVersion = 1025,
3:48:22 PM     dmSize = 124,
3:48:22 PM     dmDriverExtra = 0,
3:48:22 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
3:48:22 PM     union1 = _U1(
3:48:22 PM         printer = _U1A(
3:48:22 PM             dmOrientation = 0,
3:48:22 PM             dmPaperSize = 0,
3:48:22 PM             dmPaperLength = 0,
3:48:22 PM             dmPaperWidth = 0,
3:48:22 PM             dmScale = 0,
3:48:22 PM             dmCopies = 0,
3:48:22 PM             dmDefaultSource = 0,
3:48:22 PM             dmPrintQuality = 0,
3:48:22 PM         ),
3:48:22 PM         dmPosition = _U1B(
3:48:22 PM             x = 0,
3:48:22 PM             y = 0,
3:48:22 PM         ),
3:48:22 PM     ),
3:48:22 PM     dmColor = 0,
3:48:22 PM     dmDuplex = 0,
3:48:22 PM     dmYResolution = 0,
3:48:22 PM     dmTTOption = 0,
3:48:22 PM     dmCollate = 0,
3:48:22 PM     dmFormName = '',
3:48:22 PM     dmLogPixels = 0,
3:48:22 PM     dmBitsPerPel = 32L,
3:48:22 PM     dmPelsWidth = 1280L,
3:48:22 PM     dmPelsHeight = 1024L,
3:48:22 PM     dmDisplayFlags = 0L,
3:48:22 PM     dmDisplayFrequency = 60L,
3:48:22 PM     dmDriverExtraData = '',
3:48:22 PM )

3:48:22 PM DISPLAY_DEVICE(
3:48:22 PM     cb = 424L,
3:48:22 PM     DeviceName = '\\\\.\\DISPLAY2',
3:48:22 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
3:48:22 PM     StateFlags = ,
3:48:22 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
3:48:22 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{15EB21EC-828F-4DE7-BDB7-673C069D78AA}\\0001',
3:48:22 PM )
3:48:22 PM DEVMODE(
3:48:22 PM     dmDeviceName = '',
3:48:22 PM     dmSpecVersion = 1025,
3:48:22 PM     dmDriverVersion = 1025,
3:48:22 PM     dmSize = 124,
3:48:22 PM     dmDriverExtra = 0,
3:48:22 PM     dmFields = DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
3:48:22 PM     union1 = _U1(
3:48:22 PM         printer = _U1A(
3:48:22 PM             dmOrientation = 0,
3:48:22 PM             dmPaperSize = 0,
3:48:22 PM             dmPaperLength = 0,
3:48:22 PM             dmPaperWidth = 0,
3:48:22 PM             dmScale = 0,
3:48:22 PM             dmCopies = 0,
3:48:22 PM             dmDefaultSource = 0,
3:48:22 PM             dmPrintQuality = 0,
3:48:22 PM         ),
3:48:22 PM         dmPosition = _U1B(
3:48:22 PM             x = 0,
3:48:22 PM             y = 0,
3:48:22 PM         ),
3:48:22 PM     ),
3:48:22 PM     dmColor = 0,
3:48:22 PM     dmDuplex = 0,
3:48:22 PM     dmYResolution = 0,
3:48:22 PM     dmTTOption = 0,
3:48:22 PM     dmCollate = 0,
3:48:22 PM     dmFormName = '',
3:48:22 PM     dmLogPixels = 0,
3:48:22 PM     dmBitsPerPel = 32L,
3:48:22 PM     dmPelsWidth = 1280L,
3:48:22 PM     dmPelsHeight = 720L,
3:48:22 PM     dmDisplayFlags = 0L,
3:48:22 PM     dmDisplayFrequency = 60L,
3:48:22 PM     dmDriverExtraData = '',
3:48:22 PM )
[\code]


Projector Only
[code]
3:46:38 PM DISPLAY_DEVICE(
3:46:38 PM     cb = 424L,
3:46:38 PM     DeviceName = '\\\\.\\DISPLAY1',
3:46:38 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
3:46:38 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_MODESPRUNED,
3:46:38 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
3:46:38 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{15EB21EC-828F-4DE7-BDB7-673C069D78AA}\\0000',
3:46:38 PM )
3:46:38 PM DEVMODE(
3:46:38 PM     dmDeviceName = '',
3:46:38 PM     dmSpecVersion = 1025,
3:46:38 PM     dmDriverVersion = 1025,
3:46:38 PM     dmSize = 124,
3:46:38 PM     dmDriverExtra = 0,
3:46:38 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
3:46:38 PM     union1 = _U1(
3:46:38 PM         printer = _U1A(
3:46:38 PM             dmOrientation = -1280,
3:46:38 PM             dmPaperSize = -1,
3:46:38 PM             dmPaperLength = 0,
3:46:38 PM             dmPaperWidth = 0,
3:46:38 PM             dmScale = 0,
3:46:38 PM             dmCopies = 0,
3:46:38 PM             dmDefaultSource = 0,
3:46:38 PM             dmPrintQuality = 0,
3:46:38 PM         ),
3:46:38 PM         dmPosition = _U1B(
3:46:38 PM             x = -1280,
3:46:38 PM             y = 0,
3:46:38 PM         ),
3:46:38 PM     ),
3:46:38 PM     dmColor = 0,
3:46:38 PM     dmDuplex = 0,
3:46:38 PM     dmYResolution = 0,
3:46:38 PM     dmTTOption = 0,
3:46:38 PM     dmCollate = 0,
3:46:38 PM     dmFormName = '',
3:46:38 PM     dmLogPixels = 0,
3:46:38 PM     dmBitsPerPel = 32L,
3:46:38 PM     dmPelsWidth = 1280L,
3:46:38 PM     dmPelsHeight = 1024L,
3:46:38 PM     dmDisplayFlags = 0L,
3:46:38 PM     dmDisplayFrequency = 60L,
3:46:38 PM     dmDriverExtraData = '',
3:46:38 PM )

3:46:38 PM DISPLAY_DEVICE(
3:46:38 PM     cb = 424L,
3:46:38 PM     DeviceName = '\\\\.\\DISPLAY2',
3:46:38 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
3:46:38 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_PRIMARY_DEVICE,
3:46:38 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
3:46:38 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{15EB21EC-828F-4DE7-BDB7-673C069D78AA}\\0001',
3:46:38 PM )
3:46:38 PM DEVMODE(
3:46:38 PM     dmDeviceName = '',
3:46:38 PM     dmSpecVersion = 1025,
3:46:38 PM     dmDriverVersion = 1025,
3:46:38 PM     dmSize = 124,
3:46:38 PM     dmDriverExtra = 0,
3:46:38 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
3:46:38 PM     union1 = _U1(
3:46:38 PM         printer = _U1A(
3:46:38 PM             dmOrientation = 0,
3:46:38 PM             dmPaperSize = 0,
3:46:38 PM             dmPaperLength = 0,
3:46:38 PM             dmPaperWidth = 0,
3:46:38 PM             dmScale = 0,
3:46:38 PM             dmCopies = 0,
3:46:38 PM             dmDefaultSource = 0,
3:46:38 PM             dmPrintQuality = 0,
3:46:38 PM         ),
3:46:38 PM         dmPosition = _U1B(
3:46:38 PM             x = 0,
3:46:38 PM             y = 0,
3:46:38 PM         ),
3:46:38 PM     ),
3:46:38 PM     dmColor = 0,
3:46:38 PM     dmDuplex = 0,
3:46:38 PM     dmYResolution = 0,
3:46:38 PM     dmTTOption = 0,
3:46:38 PM     dmCollate = 0,
3:46:38 PM     dmFormName = '',
3:46:38 PM     dmLogPixels = 0,
3:46:38 PM     dmBitsPerPel = 32L,
3:46:38 PM     dmPelsWidth = 1280L,
3:46:38 PM     dmPelsHeight = 720L,
3:46:38 PM     dmDisplayFlags = 0L,
3:46:38 PM     dmDisplayFrequency = 60L,
3:46:38 PM     dmDriverExtraData = '',
3:46:38 PM )
[\code]


DFP + Projector
[code]
3:50:48 PM DISPLAY_DEVICE(
3:50:48 PM     cb = 424L,
3:50:48 PM     DeviceName = '\\\\.\\DISPLAY1',
3:50:48 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
3:50:48 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP | DISPLAY_DEVICE_MODESPRUNED | DISPLAY_DEVICE_PRIMARY_DEVICE,
3:50:48 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
3:50:48 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{15EB21EC-828F-4DE7-BDB7-673C069D78AA}\\0000',
3:50:48 PM )
3:50:48 PM DEVMODE(
3:50:48 PM     dmDeviceName = '',
3:50:48 PM     dmSpecVersion = 1025,
3:50:48 PM     dmDriverVersion = 1025,
3:50:48 PM     dmSize = 124,
3:50:48 PM     dmDriverExtra = 0,
3:50:48 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
3:50:48 PM     union1 = _U1(
3:50:48 PM         printer = _U1A(
3:50:48 PM             dmOrientation = 0,
3:50:48 PM             dmPaperSize = 0,
3:50:48 PM             dmPaperLength = 0,
3:50:48 PM             dmPaperWidth = 0,
3:50:48 PM             dmScale = 0,
3:50:48 PM             dmCopies = 0,
3:50:48 PM             dmDefaultSource = 0,
3:50:48 PM             dmPrintQuality = 0,
3:50:48 PM         ),
3:50:48 PM         dmPosition = _U1B(
3:50:48 PM             x = 0,
3:50:48 PM             y = 0,
3:50:48 PM         ),
3:50:48 PM     ),
3:50:48 PM     dmColor = 0,
3:50:48 PM     dmDuplex = 0,
3:50:48 PM     dmYResolution = 0,
3:50:48 PM     dmTTOption = 0,
3:50:48 PM     dmCollate = 0,
3:50:48 PM     dmFormName = '',
3:50:48 PM     dmLogPixels = 0,
3:50:48 PM     dmBitsPerPel = 32L,
3:50:48 PM     dmPelsWidth = 1280L,
3:50:48 PM     dmPelsHeight = 1024L,
3:50:48 PM     dmDisplayFlags = 0L,
3:50:48 PM     dmDisplayFrequency = 60L,
3:50:48 PM     dmDriverExtraData = '',
3:50:48 PM )

3:50:48 PM DISPLAY_DEVICE(
3:50:48 PM     cb = 424L,
3:50:48 PM     DeviceName = '\\\\.\\DISPLAY2',
3:50:48 PM     DeviceString = 'NVIDIA GeForce 6600 GT ',
3:50:48 PM     StateFlags = DISPLAY_DEVICE_ATTACHED_TO_DESKTOP,
3:50:48 PM     DeviceID = 'PCI\\VEN_10DE&DEV_00F1&SUBSYS_31501458&REV_A2',
3:50:48 PM     DeviceKey = '\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Video\\{15EB21EC-828F-4DE7-BDB7-673C069D78AA}\\0001',
3:50:48 PM )
3:50:48 PM DEVMODE(
3:50:48 PM     dmDeviceName = '',
3:50:48 PM     dmSpecVersion = 1025,
3:50:48 PM     dmDriverVersion = 1025,
3:50:48 PM     dmSize = 124,
3:50:48 PM     dmDriverExtra = 0,
3:50:48 PM     dmFields = DM_POSITION | DM_DISPLAYORIENTATION | DM_LOGPIXELS | DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFLAGS | DM_DISPLAYFREQUENCY,
3:50:48 PM     union1 = _U1(
3:50:48 PM         printer = _U1A(
3:50:48 PM             dmOrientation = 1280,
3:50:48 PM             dmPaperSize = 0,
3:50:48 PM             dmPaperLength = 0,
3:50:48 PM             dmPaperWidth = 0,
3:50:48 PM             dmScale = 0,
3:50:48 PM             dmCopies = 0,
3:50:48 PM             dmDefaultSource = 0,
3:50:48 PM             dmPrintQuality = 0,
3:50:48 PM         ),
3:50:48 PM         dmPosition = _U1B(
3:50:48 PM             x = 1280,
3:50:48 PM             y = 0,
3:50:48 PM         ),
3:50:48 PM     ),
3:50:48 PM     dmColor = 0,
3:50:48 PM     dmDuplex = 0,
3:50:48 PM     dmYResolution = 0,
3:50:48 PM     dmTTOption = 0,
3:50:48 PM     dmCollate = 0,
3:50:48 PM     dmFormName = '',
3:50:48 PM     dmLogPixels = 0,
3:50:48 PM     dmBitsPerPel = 32L,
3:50:48 PM     dmPelsWidth = 1280L,
3:50:48 PM     dmPelsHeight = 720L,
3:50:48 PM     dmDisplayFlags = 0L,
3:50:48 PM     dmDisplayFrequency = 60L,
3:50:48 PM     dmDriverExtraData = '',
3:50:48 PM )
So... now I owe you an apology. The "Set Display Preset" action works well as long as I use the Windows display properties to change display settings (prior to querying the settings), and not the NVidia control panel!

Nicely done! And thanks!

Mark
Post Reply