2

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.

  • Excel is indeed UI automation compatible. Do you have a sample reproducing the issue? Note the app must *run* at same UAC level (if Excel is not ran as admin, the app must not run as admin, etc.). It's not related to signature, program files, and it should be able to run w/o a manifest – Simon Mourier Feb 22 '17 at 06:15
  • Thanks for the UAC level suggestion. That did it. – RealSalazar Apr 05 '17 at 06:23
  • can you please provide sample code how you finally did it? – e-frank Jun 29 '17 at 19:32

1 Answers1

2

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.

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298