I vaguely remember SetupDiEnumDeviceInfo and I think it gives you the HDEVINFO for each interface and therefore it would (I believe) give you only one entry on my configuration because I have only one adapter. You get to specify a callback to EnumDisplayMonitors and that callback will be invoked with some parameters (if memory serves me correctly one of the parameters was a subset of the specified clipping rectangle that lands on the specified monitor). This becomes useful when you have multiple active monitors and someone decides to do something that causes a draw that will straddle multiple monitors. The former is primarily to just enumerate the adapters but the latter allows you to provide a clipping rectangle and determine which monitors that clipping rectangle happens to land on. EnumDisplayDevices shows you adapters and EnumDisplayMonitors shows you the monitors. Then, there is a difference between display adapters and monitors. (HWP26CE is the identifier for HP w2408, see here) Gives me only one instance and that instance is the external monitor (I know this because the manufacturer name is HP). If I go into display properties, I see only one screen.Ĭonnected to CIMv2 select * from Win32_DesktopMonitor ĭesktopMonitor1 is the external display (GenericPNPDisplay) and DesktopMonitor1 is the default monitor (screen).Ĭonnected to root\WMI select * from WMIMonitorID But, the laptop is closed and the laptop screen is therefore not visible. I recognize that this answer is probably not ALL that you were hoping for.įor the illustrations below (and all of these illustrations are on my Dell Latitude laptop I'm typing this to you on and I have logically two monitors connected to it through the docking station). I don't know all of these API's but I do remember some of them (bad memories) so here's what I can remember and find from poking around in MSDN and playing with wbemtest which I'm surprised I even remember. !(ddMon.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER))ĭeviceID = DeviceID.Mid (8, DeviceID.Find (L"\\", 9) - 8) If (ddMon.StateFlags & DISPLAY_DEVICE_ACTIVE & While (EnumDisplayDevices(dd.DeviceName, devMon, &ddMon, 0)) While (EnumDisplayDevices(0, dev, &dd, 0)) monitor number, as used by Display Properties > Settings This is my current work-in-progress code for detecting the monitor device id, reliably. ![]() EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |