Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Core VCL Classes/TScreen    [ Add a report in this area ]  
Report #:  88635   Status: Open
Declare TScreen.GetMonitors as public
Project:  Delphi Build #:  15.0.3890.34076
Version:    15.0 Submitted By:   Dalija Prasnikar
Report Type:  Basic functionality failure Date Reported:  10/4/2010 2:58:22 PM
Severity:    Commonly encountered problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   280698
Resolution: None (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Please declare TScreen.GetMonitors as public.
I have application that needs to be aware of changes in number of monitors and screen size. I can catch Windows
messages when change occures, but I am not able to refresh
TScreen.Monitors list when I need to, because TScreen.GetMonitors is private method.
Steps to Reproduce:

Craig Young at 9/3/2014 9:31:12 AM -
Another option would be for Delphi to detect changes to display settings and rebuild automatically.

There is actually a bug related to monitors not being refreshed (confirmed D2007). I'll try to provide a small reproducible example. But for now the general steps are as follows:
- Start an application that uses hints on a multi-monitor machine.
- Remote desktop to the machine.
- Perform an action that would activate a hint.
- The code in THintWindow.ActivateHint attempts to adjust the hint position to fit on its target monitor.
- It starts by using Screen.MonitorFromPoint which returns nil because the new virtual monitor for the desktop session is not included in FMonitors.
- And naturally an access violation occurs when attempting to use this invalid TMonitor instance.

Server Response from: ETNACODE01