?
Solved

Finding IE window, size and co-ordinates

Posted on 2004-08-03
3
Medium Priority
?
243 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
geobul earned 400 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

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…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

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