Fixing Accessibility Issues
Access "Windows Security" dialog from my MFC app
I am struggle to hit OK button from a "Windows Security" dialog, from my MFC app. Here is this dialog in Win7:
and here is the same dialog in Win10:
after a friend advice me to get informations regarding this dialogs with inspect.exe, here is what I get from introspection:
How found: Selected from tree... Name: "Windows Security" ControlType: UIA_WindowControlTypeId (0xC370) LocalizedControlType: "window" BoundingRectangle: {l:492 t:276 r:948 b:638} IsEnabled: true HasKeyboardFocus: false ProcessId: 13708 RuntimeId: [2A.1607F2] FrameworkId: "XAML" ClassName: "Credential Dialog Xaml Host" NativeWindowHandle: 0x1607F2 ProviderDescription: "[pid:6776,providerId:0x1607F2 Main:Nested [pid:13708,providerId:0x1607F2 Main(parent link):Unidentified Provider (unmanaged:Windows.UI.Xaml.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]" ClickablePoint: {x:720 y:457} LegacyIAccessible.ChildId: 0 LegacyIAccessible.DefaultAction: "" LegacyIAccessible.Description: "" LegacyIAccessible.Help: "" LegacyIAccessible.KeyboardShortcut: "" LegacyIAccessible.Name: "Windows Security" LegacyIAccessible.Role: window (0x9) LegacyIAccessible.State: focusable (0x100000) ............ FirstChild: "Windows Security" text LastChild: "Cancel" button Next: "Pagina login - Internet Explorer" window Previous: "Inspectx86" window Other Props: Object has no additional properties Children: "Windows Security" text"Close" button"" pane"OK" button"Cancel" button Ancestors: "Desktop 1" pane [ No Parent ]
and the OK button is present itself just like this:
How found: Selected from tree... Name: "OK" ControlType: UIA_ButtonControlTypeId (0xC350) LocalizedControlType: "button" BoundingRectangle: {l:517 t:581 r:718 b:613} IsEnabled: true IsOffscreen: false IsKeyboardFocusable: true HasKeyboardFocus: false AccessKey: "Alt, O" ProcessId: 13708 RuntimeId: [2A.1607F2.4.12] AutomationId: "OkButton" FrameworkId: "XAML" ClassName: "Button" IsControlElement: true IsContentElement: true ProviderDescription: "[pid:13708,providerId:0x0 Main(parent link):Unidentified Provider (unmanaged:Windows.UI.Xaml.dll)]" IsPeripheral: false LiveSettingProperty: Off (0) IsPassword: false IsRequiredForForm: false IsDataValidForForm: true ClickablePoint: {x:617 y:597} Culture: 1033 Orientation: 0 PositionInSet: 4294967295 SizeOfSet: 4294967295 Level: 4294967295 LandmarkType: none (0x0) HeadingLevel: HeadingLevel_None (0x138B2) LegacyIAccessible.ChildId: 0 LegacyIAccessible.DefaultAction: "Press" LegacyIAccessible.Description: "" LegacyIAccessible.Help: "" LegacyIAccessible.KeyboardShortcut: "Alt, O" LegacyIAccessible.Name: "OK" LegacyIAccessible.Role: push button (0x2B) LegacyIAccessible.State: focusable (0x100000) LegacyIAccessible.Value: "" ..... FirstChild: "OK" text LastChild: "OK" text Next: "Cancel" button Previous: "" pane Other Props: Object has no additional properties Children: "OK" text Ancestors: "Windows Security" window"Desktop 1" pane [ No Parent ]
this post is derived from this one: https://social.msdn.microsoft.com/Forums/en-US/337d6aa4-31eb-4e6d-a207-fd2332ad0a9d/chtmlview-access-quotwindows-securityquot-dialog?forum=vcgeneral
How can I remotely hit "OK" button, from my MFC app ? Can you give me a little help ?
Windows 10 - AutomationElement FindFirst FindAll - "Element not Available" - Operation timed out
On a windows 10 machine, I am seeing some problem where AutomationElement.FindFirst or AutomationElement.FindAll will generate the error "Element Not Available". (This never occurs in Windows 7)
On some windows 10 machines everything works find. On some other machine hosted in a different location nothing works because of this error.
After a lot of investigation I can say the machines are identical in what is installed. Only difference is where they are hosted (Performance is probably different)
The InnerException for these error is : {"Operation timed out. (Exception from HRESULT: 0x80131505)"}
So obviously it times out at searching the control.
The problem is that it times out right away, probably a fraction of a seconds.
Let say I have a toolbar with 40 buttons. If I use findfirst using AutomationID, the first 30 button will be found without problem, then starting at 31 it sometimes works and sometime not. Then button 40 never works. So it is timing out but way to quickly, pretty much instantly.
So the Question is: Where is the timeout forFindFirst & FindAll defined and how do I increase it to something more than a fraction of a second?
[Announcement] “Windows Desktop Development for Accessibility and Automation” Forum will be migrating to a new home on Microsoft Q&A!
This “Windows Desktop Development for Accessibility and Automation” Forum will be migrating to a new home on Microsoft Q&A!
We’ve listened to your feedback on how we can enhance the forum experience. Microsoft Q&A allows us to add new functionality and enables easier access to all the technical resources most useful to you, like Microsoft Docs and Microsoft Learn.
Now until July 26, 2020:
- You can post any new questions onMicrosoft Q&A or here.
From July 27, 2019 until August 10, 2020:
- New posts– We invite you to post new questions in the “Developing Windows Desktop Applications with Power Management” forum’s new home on Microsoft Q&A. The current forum will not allow any new questions.
- Existing posts– Interact here with existing content, answer questions, provide comments, etc.
August 10, 2020 onward:
- This forum will be closed to all new and existing posts and all interactions will be inMicrosoft Q&A.
We are excited about moving toMicrosoft Q&A and seeing you there.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to
MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Does dotnet Core support native UIAutomation APIs ??
Dotnet Core seem to be very Nuget intensive and since nuget doesn't have UIAutomation packages, its fruitless in trying to get UIAutomation to load in Azure. I can get it to work locally, but the UIAutomation DLLs are not found anywhere where Azure is looking for them.
I know I can get flaui from nuget, but I don't want the extra baggage since all I have to do is handle Windows File explorer.
Does anyone know an easy way to get core and UIAutomation to work together before I try google hell ??
NR