I have a Windows GUI app that uses a thread for a computation intensive call. It works fine.
From what I understand the thread is terminated when my thread function returns which means that I dont need to add a a termination to it.
However, I don't want the user to be able to run this computation intensive command while a thread is already running. How do I know if a thread is running? I can see a solution (primitive...) in which I have a variable in the main program that I set to TRUE when I enter a computation and to FALSE when the computation is done. Is there a better way? I would then check the value of this parameter prior to entering a new computation.
when I create my thread I don't give it a handler. I can do that but the thread is created in the WM_COMMAND case for the command. Would I declare this handle in the main program first then and use it to get the thread status or something along those lines?
Any input is very welcome!!!