FlaUI icon indicating copy to clipboard operation
FlaUI copied to clipboard

When menu item is clicked (e.g. File or Edit) in Notepad exception occurs using FLAUI

Open dardanshabani opened this issue 5 years ago • 4 comments

An outgoing call cannot be made since the application is dispatching an input-synchronous call. (Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))

This message is shown when I try to instantiate new automation element from point at mouse click events, using mouse hooks also.

Code snippets var clickedElement = Uia3Automation.FromPoint(e.Location);

Screenshots https://prnt.sc/w2la96

dardanshabani avatar Dec 14 '20 17:12 dardanshabani

Can you provide some more code? If I just use

var automation = new UIA3Automation();
var clickedElement = automation.FromPoint(Mouse.Position);

while the mouse is over any menu or object (even in notepad++), it works correctly.

Roemer avatar Apr 08 '21 14:04 Roemer

What is the value you get on clickedElement? is it MenuItem or Menu?

dardanshabani avatar Apr 08 '21 15:04 dardanshabani

It is MenuItem. Regardless of If I use the File menu or any item below.

Roemer avatar Apr 08 '21 15:04 Roemer

But when I use an submenu-item, this item is not directly in the tree below the "File MenuItem", instead it creates a new "File Menu" item in the root which contains the subitems as MenuItem. See: image

Roemer avatar Apr 08 '21 15:04 Roemer