Search code examples
c#.netuniqueidentifiermultiple-monitors

Identifying displays


I am trying to identify a screen in a multi-monitor setup to save some data linked to that screen. How can I reliable identify a screen, also after a reboot?

I am aware of the Screen class in .Net but Screen.DeviceName seems not be consistently pointing to one screen (for example after installing a new graphics driver).


Solution

  • I solved this by getting the DeviceID with the EnumDisplayDevices API. Seems to be unique for each screen and does not change after a driver update for example.

    WMI is out of the question for me as I tried it before and it only returns one monitor with my multi-monitor setup.