(Advanced) Close window opened in another thread
I use an additional thread (thread_2) in my code to set a boolean variable which is periodically sampled and closes the main thread if true. The user interface for the thread_2 is a MsgBox which pops up at the beginning of the main thread - and should be pressed if the user wants to stop the main thread.
When the main thread finishes, thread_2 is killed (t.abort; t = Nothing), but the MsgBox does not disappear, so the user has to press the MsgBox anyway.
Question: How do I kill the msg box when the main thread finishes ?
I tried using a "normal" window (with a button) to do the same thing, but I couldn't close it from the main thread either.
Any ideas ?