Solved

Dll on Multi Screen Monitor

Posted on 2002-06-10
1
218 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
Comment Utility
:)
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

11 Experts available now in Live!

Get 1:1 Help Now