{"record":{"id":"5db8a89fcf6a4bae","repo":"dotnet/wpf","slug":"uia-e-noclickablepoint","errorCode":"UIA_E_NOCLICKABLEPOINT","errorMessage":"description (from UiaGetErrorDescription or SR.UnknownCoreAPIError)","messagePattern":"description \\(from UiaGetErrorDescription or SR\\.UnknownCoreAPIError\\)","errorType":"exception","errorClass":"NoClickablePointException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/UiaCoreApi.cs","lineNumber":1194,"sourceCode":"            if (hr == UIA_E_ELEMENTNOTENABLED\n            || hr == UIA_E_ELEMENTNOTAVAILABLE\n            || hr == UIA_E_NOCLICKABLEPOINT\n            || hr == UIA_E_PROXYASSEMBLYNOTLOADED)\n            {\n                string description;\n                if (!UiaGetErrorDescription(out description))\n                    description = SR.UnknownCoreAPIError;\n\n                switch (hr)\n                {\n                    case UIA_E_ELEMENTNOTENABLED:\n                        throw new ElementNotEnabledException(description);\n\n                    case UIA_E_ELEMENTNOTAVAILABLE:\n                        throw new ElementNotAvailableException(description);\n\n                    case UIA_E_NOCLICKABLEPOINT:\n                        throw new NoClickablePointException(description);\n\n                    case UIA_E_PROXYASSEMBLYNOTLOADED:\n                        throw new ProxyAssemblyNotLoadedException(description);\n                }\n            }\n\n            // Not a UIA-specific exception - let COM Interop handle the rest.\n            // (Marshal.ThrowExceptionForHR automatically calls GetErrorInfo to fill in the description\n            // field - UIA sets the error info itself, so it will get propogated here.)\n            Marshal.ThrowExceptionForHR(hr);\n        }\n\n        #endregion Private Methods\n\n        #region Raw API methods\n\n        //\n        // Client-side methods...","sourceCodeStart":1176,"sourceCodeEnd":1212,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/UiaCoreApi.cs#L1176-L1212","documentation":"UiaCoreApi maps the native HRESULT UIA_E_NOCLICKABLEPOINT to NoClickablePointException. It is thrown when GetClickablePoint (or a native call requesting a clickable point) is made and the element has no point that can be clicked - either it has no ClickablePointProperty override and no bounding rectangle, or the computed point is obscured/off-screen. Message comes from UiaGetErrorDescription.","triggerScenarios":"Calling AutomationElement.GetClickablePoint() or TryGetClickablePoint-based flows where the native core returns UIA_E_NOCLICKABLEPOINT (0x80040202), e.g. on elements with zero-size rectangles or fully occluded windows.","commonSituations":"Automating elements in minimized windows; zero-size or invisible containers; elements scrolled outside the visible viewport; overlapped windows hiding the element's rect.","solutions":["Use the element's BoundingRectangle center manually after ensuring the window is restored and on-screen","Scroll the element into view and bring its window to foreground before requesting a clickable point","Prefer pattern-based interaction (InvokePattern, TogglePattern, etc.) over clicking coordinates","Use TryGetClickablePoint and fall back to other strategies instead of the throwing GetClickablePoint"],"exampleFix":"// before\nvar pt = element.GetClickablePoint();\n// after\nSystem.Windows.Point pt;\nif (!element.TryGetClickablePoint(out pt))\n{\n    var r = element.Current.BoundingRectangle;\n    pt = new System.Windows.Point(r.X + r.Width / 2, r.Y + r.Height / 2);\n}","handlingStrategy":"fallback","validationCode":"var rect = element.Current.BoundingRectangle;\nbool hasPoint = rect.Width > 0 && rect.Height > 0 && !element.Current.IsOffscreen;","typeGuard":null,"tryCatchPattern":"try { pt = element.GetClickablePoint(); }\ncatch (NoClickablePointException) { pt = CenterOf(element.Current.BoundingRectangle); }","preventionTips":["Prefer pattern-based interaction over coordinate clicks","Restore/foreground windows before clicking","Scroll elements into view first"],"tags":["uiautomation","wpf","clickable-point"],"backgroundTag":"resource-not-found","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}