Solved

Finding IE window, size and co-ordinates

Posted on 2004-08-03
3
239 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks 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.

776 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