Board index » delphi » Getting URL *FROM* IE...

Getting URL *FROM* IE...

Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

 

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


Anyone know how to get the URL *from* a
running copy of Internet Explorer 4?  I can
successfully retrieve the URL from an instance
of IE I start with CreateOLEObject, but attempting
to point a variant to an instance my program didn't
create (using GetActiveOLEObject) fails... ("Operation
Unavailable").

Any suggestions?

I have the window/module handles of the instance I'm
interested in...how do I get the URL data?

Thanks!

Reply by email would be very much appreciated!

Eric Lawrence
Applications Architect
Bayden Systems
bay...@bigfoot.com
----------------------------------------------------------------------------
--
"A strange game.  The only winning move is not to play."
----------------------------------------------------------------------------
--

Re:Getting URL *FROM* IE...


In article <6gjgej$...@dailyplanet.wam.umd.edu>, "Eric Lawrence"

Quote
<delta...@wam.umd.edu> writes:
>Anyone know how to get the URL *from* a
>running copy of Internet Explorer 4?

Not by posting eight identical messages to a newsgroup <g>

Alan Lloyd
alangll...@aol.com

Re:Getting URL *FROM* IE...


In article <6gk176$...@dailyplanet.wam.umd.edu>, Eric Lawrence
<delta...@wam.umd.edu> writes

Quote
>Anyone know how to get the URL *from* a
>running copy of Internet Explorer 4?  I can
>successfully retrieve the URL from an instance
>of IE I start with CreateOLEObject, but attempting
>to point a variant to an instance my program didn't
>create (using GetActiveOLEObject) fails... ("Operation
>Unavailable").

Try the following. Please note that I wrote this code a
while ago for demo purposes (all those HWND vars aren't
needed, and all of those ShowMessages would just confuse
the user).

procedure TIEDemoForm.URLButtonClick(Sender: TObject);
(*
 The window ownership structure for IE that we're interested in
 is as follows:

 IEFrame {main window}
   |
   SizableRebar {toolbar container}
     |
     ReBarWindow32 {address bar}
       |
       ComboBoxEx32 {address combo}
*)
var
  hWndIE,
  hWndRebar,
  hWndAdrBar,
  hWndCombo     : HWND;

  Buffer : array[0..255] of Char;
begin
  //look for the Internet Explorer main window
  hWndIE := FindWindow('IEFrame', nil);
  if  hWndIE > 0 then begin
    SendMessage(hWndIE, WM_GETTEXT, 255, integer(@Buffer[0]));
    Showmessage(Buffer); //just to prove we found it...

    //try to get a handle to IE's toolbar container
    hWndRebar := FindWindowEx(hWndIE, 0, 'SizableRebar', nil);
    if hWndRebar > 0 then begin

      //get a handle to address bar
      hWndAdrBar := FindWindowEx(hWndRebar, 0, 'ReBarWindow32', nil);
      if hWndAdrBar > 0 then begin

        //finally, locate combo box
        hWndCombo := FindWindowEx(hWndAdrBar, 0, 'ComboBoxEx32', nil);
        if hWndCombo > 0 then begin
          SendMessage(hWndCombo, WM_GETTEXT, 255, integer(@Buffer));
          Showmessage(Buffer); //<-- this is the URL!
        end
        else
          ShowMessage('IE address combo not found!');

      end
      else
        ShowMessage('IE Address bar not found!');

    end
    else
      ShowMessage('IE toolbars not found!');

  end
  else
    ShowMessage('Interner Explorer not running!');
end;
--
Jeremy Collins

Other Threads