Solved

IE's URL APP

Posted on 2004-10-16
3
151 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
my activex application give System Error.  Code: 5.  Access is denied 16 112
delphi exception 7 61
Delphi - replicating a form 8 62
oracle global variables 4 63
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

937 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

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now