Unable to get deepest IUIAutomationElement without one of Inspect.exe, Magnify.exe, Narrator.exe running

China☆狼群 提交于 2019-12-12 19:16:58

问题


I'm able to get some IUIAutomationElements inside Windows applications ONLY when an app 'X' (Inspect.exe | Narrator.exe | Magnify.exe) is running. Without 'X' running, the application from which I'm trying the get the IUAutomationElement essentially becomes a black box. For example, inside Microsoft Excel, I can obtain the cell identifier ( A1, D6, etc., ) when 'X' is running. Without 'X' in the background, the most granular detail I get is the Excel Workbook itself.

I've tried setting uiAccess=true and signing the application (using http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/Manifest+Manifest~Faqs.txt), moving it to Secure (Program Files) location and that hasn't worked.

FYI : Dev Env : C++ Project, Microsoft Visual Studio 2015, Community Edition.


回答1:


In general, for UI automation to work, the application that is automated must run at same UAC level than the application that automates it.

So for example, if Excel is not ran as admin, the automating application must not run as admin, or if Excel is ran as admin, the automating application must run as admin, etc.



来源:https://stackoverflow.com/questions/42383170/unable-to-get-deepest-iuiautomationelement-without-one-of-inspect-exe-magnify-e

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!