Solved

Finding IE window, size and co-ordinates

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help on project with Soap 10 61
Downloading email attachments 2 83
QRReport  TQrmemo vertical stretching 1 55
How to define IfThen functions in one common unit? 4 62
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

680 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