Solved

IE's URL APP

Posted on 2004-10-16
3
157 Views
Last Modified: 2010-04-05
I need one app that when the person views one site in IE, save the adress of the page in one .txt.
tnx
0
Comment
Question by:cels9
[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
3 Comments
 
LVL 4

Expert Comment

by:Evarest
ID: 12331573
This will get the URL of the currently active IExplorer

 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;

procedure TForm1.Button1Click(Sender);
begin
 Memo1.Lines.Add( Get_URL('IExplore') );
 // or for Netscape:
 Memo1.Lines.Add( Get_URL('Netscape') );
end;

You can of course set this function in a Timer and check every x msec whether the URL has changed (new window/new url)...

Good luck!
Evarest
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 500 total points
ID: 12331583
0
 
LVL 26

Expert Comment

by:EddieShipman
ID: 12358642
This will get the URL of EVERY currently open instance of IE, even the ones that are minimized or hidden (not shown):

procedure TForm1.Button1Click
  ( ASender:                   TObject
  );
var
  ShellWin : TShellWindows;
  i : integer;
  IE : IWebBrowser2;
begin
  ShellWin := TShellWindows.Create(nil);
  try
    for i := 0 to ShellWin.Count-1 do
      begin
        try
          ShellWin.Item(i).QueryInterface(IID_IWebBrowser2, IE);
          Memo1.Lines.Add( IE.LocationName + '->' + IE.LocationURL);
        except
        end;
      end;
  finally
    ShellWin.Free;
  end;
end;
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

705 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