hello,
I need to know the url on wich the user currently is.(with firefox)
I thought of a keylogger to keep track of the url,
but what when the user clicks a link?
The title`s not enough, I need the complete url.
With IE this is easy, but with firefox it isnt.
for IE i'm using:
private string GetUrlFromIE()
{
IntPtr windowHandle = GetForegroundWindow();
IntPtr childHandle;
String strUrlToReturn = "";
//IE's toolbar container
childHandle = FindWindowEx(windowHandle,IntPtr.Zero,"WorkerW",IntPtr.Zero);
if(childHandle != IntPtr.Zero)
{
//get a handle to address bar
childHandle = FindWindowEx(childHandle,IntPtr.Zero,"ReBarWindow32",IntPtr.Zero);
if(childHandle != IntPtr.Zero)
{
// get a handle to combo boxes
childHandle = FindWindowEx(childHandle, IntPtr.Zero, "ComboBoxEx32", IntPtr.Zero);
if(childHandle != IntPtr.Zero)
{
// get a handle to combo box
childHandle = FindWindowEx(childHandle, IntPtr.Zero, "ComboBox", IntPtr.Zero);
if(childHandle != IntPtr.Zero)
{
//get handle to edit
childHandle = FindWindowEx(childHandle, IntPtr.Zero, "Edit", IntPtr.Zero);
if (childHandle != IntPtr.Zero)
{
strUrlToReturn = GetText(childHandle);
}
}
}
}
}
return strUrlToReturn;
}
any ideas?