hi, all.
i create a window and another thread for a long time work. when the work thread is runing, i close the window, the work is still runing or stop?
thank you@!
i create a window and another thread for a long time work. when the work thread is runing, i close the window, the work is still runing or stop?
thank you@!
It depends on what you do for the WM_DESTROY or WM_CLOSE messages. If you PostQuitMessage, then the message loop will exit, and the process will end - which will end the second thread as well.
When you create a thread, close the returned ThreadHandle immediately to prevent a small memory leak at shutdown... terminating the main process will terminate all threads, but it won't release some thread-specific resources like the handle.