Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the active URL from IE using C#

1 view
Skip to first unread message

Deen

unread,
Nov 14, 2008, 11:25:01 PM11/14/08
to
Hello,
I am writing a C# application that need to get the active URL on IE. This
is not IE add-on but a separate application.

Here is the scenario. User is IE to browse internet. He then activate
this C# program (through systray or hotkey) so the he can bookmark the URL.
This app need to find out the previously active window if it's IE then it
will try to get the URL. I never program with IE before so I need to know if
this is possible.

I would imagine following things has to be done.

1) Find out the window handle of previously active window
2) Find out the process that owns the windows.
3) if it's IE then establish way to communicate with it. (I don't know
how) Perhaps create IE object.
4) Ask IE object with given Window handle (In case there are many windows
associate with this IE process) for the active URL. IE can have many tab but
the app need to know what user sees.

The information needed are Title of the web page and URL.

Thanks

-- Deen

0 new messages