I need to find a way to get the correct ID's of the connected screens that will be equal to the numbers present in the Windows 7 or 8 Screen Resolution window.
I tried to use WMI query and calling Win32 API functions and still i cant get the correct numbers. The DeviceName (like '\.\DISPLAY4') has nothing to do with screen number 4 as shown in the Screen Resolution window.
The same problem (without a solution) has been posted in 2010 in this url: http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/668e3cf9-4e00-4b40-a6f8-c7d2fc1afd39/how-can-i-retrieve-monitor-information?forum=windowsgeneraldevelopmentissues
Microsoft's answer was that: "There is not a supported way to figour out the IDs that you referred to programmatically. It was never a design goal to provide a way for applications to label monitors with the same IDs that the screen resolution control panel uses.".
Maybe someone has an idea how it still could be possible?