EnumDisplayDevices vs WMI Win32_DesktopMonitor, how to detect active monitors?

前端 未结 5 1468
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 13:22

For my current C++ project I need to detect a unique string for every monitor that is connected and active on a large number of computers.

Research has pointed to 2

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 14:02

    I've never tried doing it from a service, but EnumDisplayDevices generally works well when run as a user. I believe that services run in a separate (and headless) session, which could explain the problem you're seeing there.

    Could you run a helper program from your service, impersonating a user account that has access to the displays?

提交回复
热议问题