How do I get the actual Monitor name? as seen in the resolution dialog

前端 未结 5 2021
旧巷少年郎
旧巷少年郎 2020-11-27 19:31

I am trying to grab the friendly name for the monitors on my system. I am using C#.

I have tried Screen, which just gives me //./DisplayXX.

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 20:33

    After you get a DisplayDevice.DeviceName like //./DisplayX from EnumDisplayDevices, you are supposed to call 'EnumDisplayDevices' a second time, this time providing the 'DisplayDevice.DeviceName' that you got from the previous call as lpDevice, and '0' as iDevNum. Then you'll have the monitor name in DisplayDevice.DeviceString.

提交回复
热议问题