Mine is a dynamic library, It creates a thread, For desktop root node called IUIAutomation::AddStructureChangedEventHandler registered a structure change event handler, the thread has been in the running state. When clicking to exit the program, it will affect the program to call TerminateProcess and ExitProcess normally, and the window of the program is Destroyed (WM_DESTROY), but the background can not be exited. Have you ever encountered this?
Thank you.
What I have tried:
Monitor TerminateProcess, ExitProcess, not called normally;
I monitor the WM_Destroy main window, and then call RemoveStructureChangedEventHandler to remove this event, then stop the UIA threads, but have no effect;