DelphiFAQ Home Search:
General :: Programming :: Delphi :: Network
Network (local network and Internet) programming under Windows with Delphi.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Detect the current URL in Internet Explorer (DDE)

You can quickly retrieve the current Internet Explorer's URL with DDE.
There are a few problems with this technique:

  1. multiple instances of IE could be open - you have no control to which one you connect
  2. one instance with multiple windows could be open (created with IE's menu File | New | Window). Again, you have no control which one you connect to.

Ultimately, you could use EnumChildWindows() calls to check for any open IE window. This could would have to be customized for each new IE release..

uses
   DDEMan;
 
 // TForm type declaration...
 
 procedure TForm1.Button1Click(Sender: TObject);
 var
   DDE:TDDEClientConv;
 begin
   DDE:=TDDEClientConv.Create(self);
   if DDE.SetLink('IExplore','WWW_GetWindowInfo') then
   Memo1.Lines.Add(DDE.RequestData('0xFFFFFFFF,sURL,sTitle'));
   DDE.Free;
 end;
 

Generated 12:01:40 on Oct 19, 2018