Subj : Re: Return value from worker thred when the working thread must be suspend after calculation??? To : comp.os.ms-windows.programmer.win32,microsoft.public.vc.language,comp.programming.threads From : David W. Poole, Jr. Date : Tue Aug 30 2005 02:00 am On 29 Aug 2005 16:16:10 -0700, pattreeya@gmail.com was understood to have stated the following: >Hello, > > it will be a very kind of you if someone can help me with the >following problem. > > > After finish calling "Calculate" function, I would like >to send the result to the main thread and suspend the working thread. >how can i get the the return value from this threadproc to be used by >the main thread? For what it matters, whenever I have a thread that updates part of the UI, I create the thread with a structure that contains a handle to the dialog box or parent window I wish to update. When the need to update the UI is encountered by the thread, it either updates the control(s) directly, or sends a WM_APP to the window with an appropriate structure containing the value(s) for the windproc() to use to update the controls. .