static void Main(string[] args) { var DesktopHandle = GetDesktopWindow(); Console.WriteLine("Desktop Handle : " + new IntPtr(DesktopHandle).ToString("X") + "\n\n"); int FxWinHandle = GetBrowserWindow("MozillaWindowClass"); //int GCWinHandle = GetBrowserWindow("Chrome_WidgetWin_1"); if (FxWinHandle == 0) { return; //didn't find browser window } const uint OBJID_CLIENT = 0xFFFFFFFC; object pAcc = null; AccessibleObjectFromWindow(FxWinHandle, OBJID_CLIENT, IID_IAccessible.ToByteArray(), ref pAcc); IAccessible iAccessible = (IAccessible)pAcc; object pService = null; IntPtr IID_IServiceProvider = Marshal.GetIUnknownForObject(iAccessible); Guid myGuid = new Guid(); int hr = iAccessible.QueryInterface(IID_IServiceProvider, ref pService); }