How to get the display names of multiple monitors with the Win32 API?

前端 未结 1 473
时光取名叫无心
时光取名叫无心 2021-01-12 15:09

I have two monitors connected to my Windows PC -- one is a normal monitor and the other is a projector. Because Windows doesn\'t consistently assign one or the other as the

相关标签:
1条回答
  • 2021-01-12 15:36

    The EnumDisplayMonitors passes a monitor handle to the MonitorEnumProc callback function. You can pass that handle to GetMonitorInfo, being sure to pass a pointer to a MonitorInfoEx structure and setting the cbSize member accordingly.

    Upon return, the szDevice field in the MonitorInfoEx structure will contain the name of the monitor.

    0 讨论(0)
提交回复
热议问题