1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
17/2002. How to get the current URL from IE
{
You can quickly retrieve the current
Internet Explorer's URL with DDE.
There are a few problems with
this technique:
- multiple instances of IE could
be open; in most cases the code
retrieves URL from the last active
window.
}
uses
DDEMan;
// add a button and a memo on a form!
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; |