ChatGPT just damaged the code.
If you want to use Interop.UIAutomationClient from nuget, here is an example.
QM example.
If you want to use Interop.UIAutomationClient from nuget, here is an example.
// script ""
/*/ nuget -\Interop.UIAutomationClient; /*/
using UIA = Interop.UIAutomationClient;
var uia = new UIA.CUIAutomation8Class() as UIA.IUIAutomation;
var e = uia.GetFocusedElement();
print.it(e.CurrentClassName);
QM example.