Detect the current URL in Internet Explorer (Views: 100)
Detect the current URL in Internet Explorer
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 - you have no control to which one you connect
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..
// TForm type declaration...
procedure TForm1.Button1Click(Sender: TObject);
DDE := TDDEClientConv.Create(self);
if DDE.SetLink('IExplore', 'WWW_GetWindowInfo') then
<< Back to main page