How can I get monitors numbers from Screen Resolution dialog in win7 programmatically?

前端 未结 3 2411
别那么骄傲
别那么骄傲 2020-12-05 16:14

When you press Identify button in Screen Resolution dialog then Windows shows you big white monitor numbers on each monitor. It was easy to find them programmatically togeth

3条回答
  •  感动是毒
    2020-12-05 16:38

    For Windows versions supporting WDDM, which Windows 7 does, you can simply use DXGI which is part of DirectX. DXGI allows you to very easily enumerate the existing display adapters, the available display outputs per adapter and the supported display modes per display output. While enumerating there's a lot of additional data you can read out, like handles, identifiers and device names. All of this can easily be used to retrieve the working areas as well. The order in which adapters and outputs are enumerated is defined by the system and matches the order of your configuration screen.

    See here for more information: MSDN DXGI Overview

提交回复
热议问题