Multi Monitor System

I want to make a little program which can detect how many monitors are attached to the system, and send different forms to different monitors.

Example:

I have three monitors on my system, and want to make sure that the program automatically choose the left one for the display of help screen. Sure, i can drag it to that position and let it remind it, but that is not what i want.
WMPetersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheNeilCommented:
That's a tricky one. My undrestanding of how Windows treats multi monitors is just to create a HUGE desktop that streches across the all the screens. This means that Delphi only sees ONE desktop. What you COULD do is have a setting which allows the user to define how big each of the screens is. Then when you fire up the help dialog (or whatever) you can place it in the correct monitor by defining where on the DESKTOP you want the form to appear (e.g. Screen 1 is 800x600, screen 2 is also 800x600. To make form1 appear on screen 1, set it's top left to (0,0), and to make form2 appear on screen 2, set it's top left to (800,0))

It's not an ideal solution but short of fumbling about in the registry, this is the only way that I know of - hope it helps

The Neil
0
hubdogCommented:
use TForm.SetwindowtoMonitor
procedure SetWindowToMonitor(Form: TCustomForm;MonitorIndex,Left, Top: Integer );
begin
  if not Assigned(Form) then Exit;
  if MonitorIndex >= Screen.MonitorCount then Exit;
  with Screen do
  begin
    Inc(Left, Monitors[MonitorIndex].Left);
    Inc(Top, Monitors[MonitorIndex].Top);
  end;
  Form.SetBounds(Left, Top, Form.Width, Form.Height);
end;

good luck

hubdog
0
hubdogCommented:
to get monitercount
use tscrenn.monitercount

hubdog
0
hubdogCommented:
forget mark the question as locked

hubdog
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
WMPetersAuthor Commented:
Forgot to say thanks...
So...THANKS, it works good.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.