System.Windows.Automation.AutomationElement.TryGetClickablePoint C# (CSharp) Method

TryGetClickablePoint() public method

public TryGetClickablePoint ( Point &pt ) : bool
pt Point
return bool
        public bool TryGetClickablePoint(out Point pt)
        {
            pt = new Point(0.0, 0.0);
            UIAutomationClient.tagPOINT nativePoint = new UIAutomationClient.tagPOINT();
            try
            {
                bool success = this._obj.GetClickablePoint(out nativePoint) != 0;
                if (success)
                {
                    pt.X = nativePoint.x;
                    pt.Y = nativePoint.y;
                }
                return success;
            }
            catch (System.Runtime.InteropServices.COMException e)
            {
                Exception newEx; if (Utility.ConvertException(e, out newEx)) { throw newEx; } else { throw; }
            }

        }

Usage Example

Example #1
0
 public static void AutomationElementTryGetClickablePoint(AutomationElement element)
 {
     Dump("TryGetClickablePoint()", true, element);
     Point pt = new Point();
     try
     {
         object obj = element.TryGetClickablePoint(out pt);
     }
     catch (Exception exception)
     {
         VerifyException(element, exception, typeof(ElementNotAvailableException));
     }
 }
All Usage Examples Of System.Windows.Automation.AutomationElement::TryGetClickablePoint