Access is denied - when trying to get the url (text) from address bar's handle
I'm trying to extract the URL from the address bar of IE. (IE 8 on Windows 7) using the following C# code. static string GetUrlFromIE() { IntPtr windowHandle = APIFuncs.getForegroundWindow(); IntPtr childHandle; String strUrlToReturn = ""; //try to get a handle to IE's toolbar container childHandle = APIFuncs.FindWindowEx(windowHandle, IntPtr.Zero, "WorkerW", IntPtr.Zero); if (childHandle != IntPtr.Zero) { //get a handle to address bar childHandle = APIFuncs.FindWindowEx(childHandle, IntPtr.Zero, "ReBarWindow32", IntPtr.Zero); if (childHandle != IntPtr.Zero) { childHandle = APIFuncs