Re: New process
I can think of a couple of things to try...
1. Create a mutex between the GUI program and the program that reads the
config file so they can communicate.
2. When you start each program using ShellExecuteEx() or CreateProcess() so
you can get an instance handle returned from the program then pass that back
to the GUI so it can locate the program (the startup triggers the GUI that
something has happened).
http://msdn2.microsoft.com/en-us/library/tt45160e(VS.80).aspx
or
1. The GUI could just loop doing a FindWindow() call on any of the programs
you know might be started.
Tom
"CodeTestDummy" <sharp_mind@REMOVE.this.email.msn.dotcom> wrote in message
news:upOn9MMCHHA.1824@TK2MSFTNGP06.phx.gbl...
My ultimate objective is, I have a GUI program that I am writing. My GUI
program call another program (a command line program), the command line
program then runs a number of other programs that is in it config file. I
Would like to know when each one of those programs are executed so my GUI
program can give a status. Keep in mind that when these programs are
running, they are running under WinPE. So, other than the OS processes
only programs will be running. I need a way to give status to the user so
they know something is going on.
Thanks
"William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in message
news:u6rG77GCHHA.3448@TK2MSFTNGP03.phx.gbl...
"CodeTestDummy" <sharp_mind@REMOVE.this.email.msn.dotcom> wrote in
message news:%23YOf0DGCHHA.4992@TK2MSFTNGP03.phx.gbl...
How can I tell programmability when a new process starts
and end. Like Task Manager.
AFAIK, the only way to get notification of new process creations is with
PsSetCreateProcessNotifyRoutine() and to use it, you'd need to be in
kernel mode.
Alternatively, you can periodically scan the list of processes with
Process32First/Process32Next/CreateToolhelp32Snapshot
Given that TASKMGR already does that, what's your ultimate objective?
Regards,
Will