Enable / disable multiple monitors through the Win32 API or the NVidia API?

I am trying to write a small utility that will enable / disable monitors under Windows 7 with my nVidia graphics card. (i.e., โ€œExtend the desktop on this monitorโ€, etc.)

The reason is that my nVidia Geforce GTX 480 has three outputs (2x DVI, 1x Mini-HDMI), but only allows two to be active at any given time, so I need to turn on / off the monitors when I want to switch to my TV (HDMI).

The Win32 EnumDisplayDevices API function does not work because it does not show disabled monitors.

nVidia provides an API (NVAPI) and has the function of listing all monitors (even disabled), and you can turn on the monitor, but you cannot turn off the monitor. (I mean NvAPI_CreateDisplayFromUnAttachedDisplay)

UltraMon seems to understand how to accomplish this, but I cannot find any information.

+6
source share
1 answer

I think that if 2 of the three displays are already connected, the third will not be detected. the card will stop listening to new equipment. You must manually remove the cable and then insert a new one into another port. if there is no way to โ€œpushโ€ the connection, similar to a USB storage device.

0
source

Source: https://habr.com/ru/post/892509/


All Articles