How to stop search process in Automation?

D.D.K-2637
966
Reputation points
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..
Thanks you!
Windows development | Windows API - Win32
2,787 questions
Developer technologies | C++
3,977 questions
Sign in to answer