Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
COM error Class not registered
#4
Thanks for your help.
I just realized that the key to solving the problem lies in the following code.
It seems that many functions in the code are specific to LA, and converting them into generic C# code is too difficult for me.  Huh

I would like to convert it into generic C# code and then call it in the filtering function in QM.
 
Code:
Copy      Help
internal static bool GetCaretRectInPowerShell(out RECT r) {
        var t = ElementFocused();
        if (t != null && 0 == t.get_CurrentControlType(out var ct) && ct == UiaApi.TypeId.Edit) {
            if (0 == Uia.get_RawViewWalker(out var walker)) {
                UiaApi.IUIAutomationElement e = null;
                while (0 == (e == null ? walker.GetFirstChildElement(t, out e) : walker.GetNextSiblingElement(e, out e)) && e != null) {
                    //if (0 == e.get_CurrentControlType(out ct)) print.it(ct);
                    //if (0 == e.get_CurrentAutomationId(out var ai)) print.it(ai);
                    if (0 == e.get_CurrentAutomationId(out var ai) && ai.Find("Caret", true) >= 0 && 0 == e.get_CurrentControlType(out ct) && ct == UiaApi.TypeId.Custom) {
                        if (0 == e.get_CurrentBoundingRectangle(out r)) {
                            return true;
                        }
                    }
                }
                //There are 3 child elements. The first is caret.
                //This is slow. Tested MSAA, but it gets only child element "selection", and cannot get rect when selection empty.
            }
        }
        r = default;
        return false;
    }

I'm not sure if it's possible to implement similar code in QM like LA. If possible, that would be great because when using QM, many controls cannot find the text insertion point.


Messages In This Thread
COM error Class not registered - by Davider - 02-02-2024, 12:37 AM
RE: COM error Class not registered - by Gintaras - 02-02-2024, 06:35 AM
RE: COM error Class not registered - by Gintaras - 02-02-2024, 07:59 AM
RE: COM error Class not registered - by Davider - 02-02-2024, 08:07 AM
RE: COM error Class not registered - by Gintaras - 02-02-2024, 08:16 AM
RE: COM error Class not registered - by Davider - 02-02-2024, 12:01 PM
RE: COM error Class not registered - by Davider - 02-03-2024, 01:35 AM
RE: COM error Class not registered - by Gintaras - 02-03-2024, 05:50 AM
RE: COM error Class not registered - by Davider - 02-03-2024, 11:13 AM
RE: COM error Class not registered - by Gintaras - 02-03-2024, 12:33 PM
RE: COM error Class not registered - by Davider - 02-03-2024, 09:30 PM
RE: COM error Class not registered - by Gintaras - 02-04-2024, 05:07 AM
RE: COM error Class not registered - by Davider - 02-06-2024, 11:04 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)