I'm working on a project where I take screenshots of individual monitors (TMonitor
) and stream their images through network (remote desktop viewing). Suppose a monitor is added/removed (which I can recognize this already), I need to synchronize which monitor this happened to. Because, suppose there's 3 monitors, indexes 0, 1, 2. Monitor 1 is removed. I don't want to automatically change index 2 to 1, I want it to maintain an ID at all times. Is there any property I can recognize in the TMonitor
class (Screen.Monitors[i]
) to uniquely identify it?
How to uniquely identify a monitor?
Asked Answered
Does the Windows handle stay the same? If not, you could try working with the monitor resolution. There doesn't seem to be any kind of unique identifier. –
Ytterbite
I would say that the Handle
property of TMonitor
will be unique at all times.
According to the documentation:
A physical display has the same
HMONITOR
as long as it is part of the desktop.
HA! I can't believe I didn't see that, I was looking for
ID
–
Bissextile © 2022 - 2024 — McMap. All rights reserved.