Solved

Dll on Multi Screen Monitor

Posted on 2002-06-10
1
220 Views
Last Modified: 2010-08-05
My app runs on a multi screen monitor. it showed a button on the 1st and 2nd monitor,so that when you click it it knows which monitor you clicked on. Then it calls a dll, but the dll always appear on the 1st monitor, center aligned. Even if i hard code the left property of the dll form, it still shows on the 1st monitor center aligned.

How can i make the dll form show on my specified left property?  (by the way, other forms aside from dll appears correctly either on second or first monitor)
0
Comment
Question by:JPDP
1 Comment
 
LVL 12

Accepted Solution

by:
Lee_Nover earned 500 total points
ID: 7069224
:)
I had this problem yesterday

I found no other (working) solution than to write a handler on the forms Activate event


var PosRect: TRect;
    FirstActivate: Boolean;

when you call your dll and display the form set it's coordinates (PosRect variable)

when the form is Activated set the coordinates :

procedure TDllForm.FormActivate(Sender: TObject);
begin
  if FirstActivate then
  begin
    FirstActivate:=false;
    SetBounds(PosRect.Left, PosRect.Top, PosRect.Right, PosRect.Bottom);
  end;
end;


I tried lots of ways with SetwindowPos from the calling process .. nothing worked
this was the only way I could get it to work
this also depends on the forms ParentWindow !
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question