Solved

Dll on Multi Screen Monitor

Posted on 2002-06-10
1
219 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now