Solved

IE's URL APP

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

12 Experts available now in Live!

Get 1:1 Help Now