Solved

Finding IE window, size and co-ordinates

Posted on 2004-08-03
3
237 Views
Last Modified: 2010-08-05
Hey there,
Im trying to make an application which can find a particular IE window, lets say with the title 'page123'. If there is an internet page with this title open, my application needs to be able to find its current co-ordinates, and the size of the window.
Aswell as this, my application needs to then be able to place itself in the SAME co-ordinates.
Anyhelp is appreciated.
Regards
GreenAndroid
0
Comment
Question by:Greenandroid
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 100 total points
Comment Utility
Hi,

Add one TEdit and one TButton on a form, write the IE title you are looking for in the edit box and press the button:

procedure TForm1.Button1Click(Sender: TObject);
var
  h: HWND;
  r: TRect;
begin
  h := FindWindow('IEFrame', PChar(Edit1.Text));
  if IsWindow(h) then begin
    if GetWindowRect(h, r) then begin
      SetWindowPos(self.Handle, HWND_TOP, r.Left, r.Top, r.Right - r.Left, r.Bottom - r.Top, SWP_SHOWWINDOW);
    end;
  end;
end;

Regards, Geo
0
 
LVL 2

Author Comment

by:Greenandroid
Comment Utility
Thanks Geobul,
Your solution works absolutely great. With a little bit of tweaking, i've got the code to work just how i need it to.
Top answer!

Regards
GreenAndroid
0
 
LVL 17

Expert Comment

by:geobul
Comment Utility
You are welcome :-)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

7 Experts available now in Live!

Get 1:1 Help Now