Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uniquely identify a monitor?

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?

like image 702
Jerry Dodge Avatar asked Jun 17 '12 21:06

Jerry Dodge


1 Answers

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.

like image 103
NGLN Avatar answered Sep 19 '22 13:09

NGLN