Solved

Finding IE window, size and co-ordinates

Posted on 2004-08-03
3
238 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
ID: 11703182
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
ID: 11703599
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
ID: 11704132
You are welcome :-)
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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

896 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