When menu item is clicked (e.g. File or Edit) in Notepad exception occurs using FLAUI
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
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.
What is the value you get on clickedElement? is it MenuItem or Menu?
It is MenuItem. Regardless of If I use the File menu or any item below.
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:
