Exemplo n.º 1
0
 public static IAccessible GetAccessibleObject(IntPtr hWnd, Point point)
 {
     try {
         IAccessible accObj;
         object      obj = new object();
         POINT       pt  = new POINT();
         pt.X = point.X;
         pt.Y = point.Y;
         UnsafeNativeMethods.ClientToScreen(hWnd, ref pt);
         if (UnsafeNativeMethods.AccessibleObjectFromPoint(pt, out accObj, out obj) != IntPtr.Zero)
         {
             return(null);
         }
         if (accObj == null)
         {
             return(null);
         }
         return(accObj);
     }
     catch {
         return(null);
     }
 }