I am able to detect all the monitors that are connected to my system. I am able to get a lot of relevant information about them using the following Windows API calls:
The system I am developing on is an AIO (all-in-one) that comes with 2 monitors. It has an external HDMI output that I can connect and external monitor. Then, through a port replicator I am able to connect the 4th monitor. All of the monitors are extending my desktop and all of them are working fine.
My task is to detect the monitor that is connected through the HDMI port. The monitor information that I am able to extract using the above mentioned API do not give any specific information through which I will be able to detect the port type (e.g. HDMI, or USB).
Does anyone know what API to use? Thanks!
You can use the
EnumDisplayDevices
method to get theDeviceID
of the monitor and then theWmiMonitorConnectionParams
WMI class (available since Windows Vista) and theVideoOutputTechnology
property which returns aD3DKMDT_VIDEO_OUTPUT_TECHNOLOGY
enumeration.Try the next sample code
This will return something like