659 Subj : Re: design issue To : borland.public.cpp.borlandcpp From : Jogy Date : Mon Jun 07 2004 11:29 am mike wrote: > Hi, > > i was debating over a design issue and i wanted to know what everyone else > thinks. > > i have a process that my GUI spawns off. i want to know when the process is > complete. the 2 ways i'm debating over is: > > 1.) use the WM_TIMER message and monitor the process id there. if the > process id is not running, then the process is done. > 2.) create a thread and use the WaitForSingleObject () and exit the thread > when process exits. > Hello, I think that the whole idea of Windows programming model is event-based, as oposed to the programming under DOS, where you nedded to constantly monitor the state of the keyboard and other resources in a loop. So, the WaitForSingleObject() should be more appropriate, I have used it in several applications with no problem, and it's quite simple: http://personal.sirma.bg/Jogy/examples.html#LaunchApp I am not sure about the WM_TIMER messages, there may be issues if there is a lot of processing and other messages going on, you might not receive all the WM_TIMERs .... > for now there are about 3 processes i need to monitor. therefore was curious > what kind of impact an application takes if i create many threads. is this > bad? if so, why? to me threading it out seems to be much more efficient and > i was leaning to go down that route. > > any suggestions/explanations will be greatly appreciated!! > > aloha, > mike > > -- Jogy http://www.jogy.net/ jogy@sirma.bg . 0