Win32 programming advice needed for OSProcess port

David T. Lewis lewis at mail.msen.com
Wed Feb 20 20:20:40 UTC 2002


On Wed, Feb 20, 2002 at 12:51:17PM -0600, Mark A. Schwenk wrote:
> 
> I'd go for a single process that creates a message-only window to serve as 
> its message queue ... gets messages containing more process handles to
> wait on from other processes doing a SendMessage to its window message
> queue, and then uses MsgWaitForMultipleObjects to wait for a process
> termination or a message with another process handle to wait on.

> Since you are new to Windows programming, you may not be aware of the 
> online references at http://msdn.microsoft.com.

Thank you. I actually did not know to look here (doh!) so this is quite
helpful.

I'm not sure if a message queue will help in this case. In this scenario,
the process which wants to receive the message (or the signal, or
whatever) is the Squeak VM, and the process which we want to have
send a message on exit is some arbitrary Windows process (maybe
running a SOL.EXE solitaire game, or some such useful thing). We know
the ID and handle for the external process (solitaire) because we started
it from Squeak. We can get the exit status of the external process after it
exits. Once things are running nicely, Squeak will be keeping track of
a constantly changing collection of external processes. I can see how
it might be helpful to have one thread in the Squeak VM talking to a
message queue to keep track of this, but the potentially tricky part is
that we still need a way for a process (either the VM or some other
process under the control of the VM) to be reliably notified when one
of the external processes exits. Actually, I don't even mind getting
notified more than once for the same event, just as long as none of
the events are missed.

Thanks for your help and for the pointers to MSDN.

Dave




More information about the Squeak-dev mailing list