Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualgretty

Posted 08 February 2013 - 11:25 PM

Hello

 

Using C++ WinAPI, I have have found out a monitors' device name by inspecting the value DEV_BROADCAST_DEVICEINTERFACE.dbcc_name and I am attempting to use that device name inside the function EnumDisplaySettings() (the device name is the first parameter of that function).

My Problem: The function EnumDisplaySettings() always returns 0, ie, fails. I believe it fails because MSDN says the first parameter of EnumDisplaySettings() should be a DISPLAY_DEVICE.DeviceName returned from EnumDisplayDevices whereas my device name is from DEV_BROADCAST_DEVICEINTERFACE.dbcc_name.

Using DEV_BROADCAST_DEVICEINTERFACE.dbcc_name I get the device name \\?\DISPLAY#GSM3AD7#5&20a3f50d&0&UID513#{866519b5-3f07-4c97-b7df-24
c5d8a8ccb8}
for my second monitor whereas EnumDisplayDevices() gives me the device name \\.\DISPLAYV1.

Is it possible to use EnumDisplaySettings() where the 1st parameter is a device name retrieved from the function DEV_BROADCAST_DEVICEINTERFACE.dbcc_name?

The reason why I ask is: when a second monitor gets connected to the computer I want to change that monitors display settings. But upon monitor connection I am notified of its device name through DEV_BROADCAST_DEVICEINTERFACE.dbcc_name which (as I explained above) is a different name to what EnumDisplayDevices() returns for the exact same device. And I dont know how I could identify that second monitor by enumerating though all display devices using EnumDisplayDevices()? Any ideas how I could enumerate though all display devices using EnumDisplayDevices() and identify the correct monitor/device that was just connected to the computer?


#1gretty

Posted 08 February 2013 - 11:23 PM

Hello

 

Using C++ WinAPI, I have have found out a monitors' device name by inspecting the value DEV_BROADCAST_DEVICEINTERFACE.dbcc_name and I am attempting to use that device name inside the function EnumDisplaySettings() (the device name is the first parameter of that function).

My Problem: The function EnumDisplaySettings() always returns 0, ie, fails. I believe it fails because MSDN says the first parameter of EnumDisplaySettings() should be a DISPLAY_DEVICE.DeviceName returned from EnumDisplayDevices whereas my device name is from DEV_BROADCAST_DEVICEINTERFACE.dbcc_name.

Using DEV_BROADCAST_DEVICEINTERFACE.dbcc_name I get the device name \\?\DISPLAY#GSM3AD7#5&20a3f50d&0&UID513#{866519b5-3f07-4c97-b7df-24
c5d8a8ccb8}
for my second monitor whereas EnumDisplayDevices() gives me the device name \\.\DISPLAYV1.

Is it possible to use EnumDisplaySettings() where the 1st parameter is a device name retrieved from the function DEV_BROADCAST_DEVICEINTERFACE.dbcc_name?

The reason why I ask is: when a second monitor gets connected to the computer I want to change that monitors display settings. But upon monitor connection I am notified of its device name through DEV_BROADCAST_DEVICEINTERFACE.dbcc_name which (as I explained above) is a different name to what EnumDisplayDevices() returns for the exact same device. And I dont know how I could identify that second monitor by enumerating though all display devices using EnumDisplayDevices()? Any ideas how I could enumerating though all display devices using EnumDisplayDevices() and identify the correct monitor/device that was just connected to the computer?


PARTNERS