Delphi screen enumeration
Posted on 2007-08-01
In Delphi, how do you get the left most screen?
For example, using a form that you want to remain hidden, you can set the Left to a negative width:
Self.Left := -Width;
The page this is for contains a TWebBrowser control, and therefore cannot have its visibility set to false, otherwise the pages do not fully load. Per Microsoft, the Left should be assigned -Width.
This is simple on a single screen. However, and for example, I have two screens. My left screen starts at -1440.. so if I set the form left position to -Width, it just appears on my left screen.
How do you enumerate all screens, and get the left most position?