Termination of Dos based app with Win32 thread.
Posted on 2004-08-02
I have an application. It uses a thread to call up an external application. A dos based app called WGet. WGet retrieves files for me.
Since WGet is ran in a thread (as I need it to be) I provide a way for the early termination of the thread.
But when the thread is terminated early by my choice (a button) I find that I need to close the window. I use FindWindow with the classname of the WGet application. Then I use SendMessage with WM_CLOSE.
What happens is I get that annoying Dos type messagebox...
Windows cannot shut down this program automatically.
It is recommended that you exit the program with it's quit or exit command....
Do you wish to terminate the program now... (Yes) (No).
I would like to either force the dos app to close without this message.
Or hear a better solution?