0

A Google search returns zero examples of how to use an AcceleratorKey in UIAutomation. I am trying to activate the "Open" submenu from a "File" menu by passing the "CTRL+O" accelerator key (InvokePattern).

If anyone knows how to do this please post an example. Thanks.

Edit: Thanks Jimi. I still can't link to the OPEN element. Result is always NOTHING. I tried some of the other menu items and same issue.

Screenshot

Code

Rob123
  • 1
  • 2
  • You have to send `CTRL + O` (assuming that's the accelerator key associated to the File/Open sub menu in the current language) to the main Window, or use the `ExpandCollapsePattern` to open the menu, find the Element with that AcceleratorKey property value and use its `InvokePattern`, since you're sure that when an Element has an associated accelerator, it also implements the `InvokePattern` – Jimi Jul 28 '22 at 18:33
  • These may help: [UI Automation Control Desktop Application and Click on Menu Strip](https://stackoverflow.com/a/56281535/7444103) -- [How to use SendInput to simulate the UP arrow key press (or other extended keys)](https://stackoverflow.com/a/71589883/7444103) – Jimi Jul 28 '22 at 18:33

0 Answers0