How to stop search process in Automation?

D.D.K-2637 966 Reputation points
2023-09-12T15:33:23.44+00:00

Hi,

Is there a way to safely terminate the IUIAutomation search process?

Here is the code I am using:

element->GetCurrentPatternAs(UIA_TextPatternId, IID_PPV_ARGS(&telement));

I created a keyboard_hook that stops my code.

However, if I press the escape key while the search is in progress, the application crashes..

Screenshot_2

Thanks you!

Windows development | Windows API - Win32
Developer technologies | C++
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.