Link to home
Start Free TrialLog in
Avatar of alloc
alloc

asked on

Iexplorer event sinking

Hello Experts.

 Ive looked through many solutions from the last 4 yrs and was wondering how one would set a hook to monitor everytime the default browser is opened (created process) and the listboxEx contains text (Uniform Resource Locator). I downloaded the EventSinkImp utility delphi unit and it seems to work great on IE except it involves you to physically invoke the browser in order to connect() to it and monitor it's events/msg's via pressing of a button. Are there any solutions that only monitor links in the address bar which then immediately report to your delphi app? I dont want to have to click a button to monitor something, everytime a new window of IE opens I want it to report the URL or everytime the text changes I want it to add to a list of already listed URLs. The event sink component seems to work great but I do NOT want to have to press a button everytime I run it to launch IE. You can download the component and demo here
http://www.techvanguards.com/files/IE4SinkDemo.zip

 I'm open to any coding techniques which does NOT require you to click a button to start the message event listening on the browser. I'd like to hook it in some fashion to avoid user interaction (pressing of a button).

 Regards,
    Alloc
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Run the code in the button click in the FormShow, DUH!

Now, what if someone's default browser is FireFox or Opera, or Netscape, or Mozilla? How do you plan on getting those URLs?
Avatar of alloc
alloc

ASKER

EddieShipman,
Well Ive already tried that, I'm not that clueless, and what happens is the demo project requires the code under the button click event to execute the browser in order to sink it's messages. In other words it opens the browser and I dont want to do this. I only want to execute IExplorer.exe directly rather than through my project code to have it auto-hook these messages.

And in regards to "what if someone's default browser is FireFox or Opera, or Netscape, or Mozilla? How do you plan on getting those URLs?" I'm only mainly concerned about Ineternet Explorer at this point in time.

 Thanks,
  Alloc
Avatar of alloc

ASKER

Maybe it would be better to use this funtion on a timer:

function Get_URL(Servicio: string): String;
var
 Cliente_DDE: TDDEClientConv;
begin
  Result := '';
  Cliente_DDE:= TDDEClientConv.Create( nil );
  with Cliente_DDE do
    begin
      SetLink( Servicio,'WWW_GetWindowInfo');
      Result := StrPas(RequestData('0xFFFFFFFF'));
      CloseLink;
    end;
  Cliente_DDE.Free;
end;

// And call it with Get_Url('IExplore');

And to avoid repeats filter the returned strings (URLs) in a stringlist then place them into a listbox so that I only get new Urls and not repeated (idle) pages left open in the browser.

 Would this work, or would it be better to hook the browser using event sinking? I'm open to suggestions and could use an example or a decent string compare function for what I want to do.
 
Thanks,
 Alloc
Avatar of alloc

ASKER

hello?
If you do that, you need to have it in a separate thread as it will hog resources and possibly run the CPU% to a high level.

I'm going to take the eventsink demo and do something that I just thought of. I'll get back with you.
Avatar of alloc

ASKER

Ok, yea I imagine it would do that
ASKER CERTIFIED SOLUTION
Avatar of Eddie Shipman
Eddie Shipman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alloc

ASKER

k I'll mess with it thanks...
Might post again about this subject in the future if I cannot resolve a way to update the listbox.

Alloc