How to uniquely identify a monitor?

I am working on a project where I take screenshots of individual monitors ( TMonitor ) and transfer their images through the network (viewing on a remote desktop). Suppose the monitor is added / removed (that I can find out already), I need to synchronize with which monitor this happened. Because, suppose there are 3 monitors, indexes 0, 1, 2. Monitor 1 is removed. I do not want to automatically change the index 2 to 1, I want it to always support the identifier. Is there any property that I can recognize in the TMonitor class ( Screen.Monitors[i] ) to uniquely identify it?

+6
source share
1 answer

I would say that the Handle TMonitor property will be unique at all times.

According to the documentation :

The physical display has the same HMONITOR as long as it is part of the desktop.

+14
source

Source: https://habr.com/ru/post/918304/


All Articles