public bool checkHandle() { Guid guid = new Guid("{618736E0-3C3D-11CF-810C-00AA00389B71}"); object obj = null; int retVal = AccessibleObjectFromWindow(handle, (uint)OBJID.WINDOW, ref guid, ref obj); iAccessible = (IAccessible)obj; //The AccWindowName returned is Add-ons Manager - Mozilla Firefox //There is a special child id called CHILDID_SELF (this constant equals 0) that, when used with a function like get_accChild, returns the element itself rather than a child. string accWindowName = iAccessible.get_accName(0); string accWindowVal = iAccessible.get_accValue(0); Console.WriteLine("IAccessible Name : " + accWindowName); Console.WriteLine("IAccessible value : " + accWindowVal); Console.WriteLine("IAccessible Role is : " + iAccessible.get_accRole(0)); Console.WriteLine("IAccessible Type: " + iAccessible.GetType()); Console.WriteLine("IAccessible Focus is: " + iAccessible.accFocus); Console.WriteLine("IAccessible Selection is " + iAccessible.get_accState()); //iAccessible.accSelect((int)OBJID.SELFLAG_TAKEFOCUS, 0); if (!accWindowName.Contains("Mozilla Firefox")) return false; getChild(iAccessible,false); //End of for window Console.WriteLine("End of checkHandle"); iAccessible = null; return false; }
public bool checkHandle() { Guid guid = new Guid("{618736E0-3C3D-11CF-810C-00AA00389B71}"); object obj = null; int retVal = AccessibleObjectFromWindow(handle, (uint)OBJID.WINDOW, ref guid, ref obj); iAccessible = (IAccessible)obj; //The AccWindowName returned is Add-ons Manager - Mozilla Firefox //There is a special child id called CHILDID_SELF (this constant equals 0) that, when used with a function like get_accChild, returns the element itself rather than a child. string accWindowName = iAccessible.get_accName(0); string accWindowVal = iAccessible.get_accValue(0); Console.WriteLine("IAccessible Name : " + accWindowName); Console.WriteLine("IAccessible value : " + accWindowVal); Console.WriteLine("IAccessible Role is : " + iAccessible.get_accRole(0)); Console.WriteLine("IAccessible Type: " + iAccessible.GetType()); Console.WriteLine("IAccessible Focus is: " + iAccessible.accFocus); Console.WriteLine("IAccessible Selection is " + iAccessible.get_accState()); //iAccessible.accSelect((int)OBJID.SELFLAG_TAKEFOCUS, 0); if (!accWindowName.Contains("Mozilla Firefox")) { return(false); } getChild(iAccessible, false); //End of for window Console.WriteLine("End of checkHandle"); iAccessible = null; return(false); }