windows: get number of monitors, including disabled ones

后端 未结 2 2008
轻奢々
轻奢々 2021-01-15 02:09

EnumDisplayMonitors lists all the monitors that are currently activated. However, it doesn\'t seem to return disabled ones (i.e. ones that have \'extend my des

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-15 02:46

    Did you check the monitor display functions?

    I am pretty sure that the MONITORINFOF_PRIMARY flag of the MONITORINFO structure specifies which monitor is the primary monitor. Any monitor that has MONITORINFO or MONITORINFOEX structure is a "useful" monitor.

    http://msdn.microsoft.com/en-us/library/dd145065(v=VS.85).aspx

    As far as what monitors are available this link allows you to check for those:
    Get Monitor Info: http://msdn.microsoft.com/en-us/library/dd144942(v=VS.85).aspx
    Enum Display Devices: http://msdn.microsoft.com/en-us/library/dd162609(VS.85).aspx
    Display Device Structure: http://msdn.microsoft.com/en-us/library/dd183569(v=VS.85).aspx

    The Display Device Structure has a "DISPLAY_DEVICE_ACTIVE" flag which indicates if the device is active.

提交回复
热议问题