You can do that by having a know way of sending a message to that
application, in response to which it can just exit. Use
RegisterWindowMessage() with the same message name in both applications.
When the message arrives in the one to be exited, exit it! Send it using
SendMessage( HWND_BROADCAST, ... ) from the other one. There is
*absolutely, positively* no good reason why you should have to use
TerminateProcess on a program for which you have the source and know that
you'll need to cause an exit from.
Paul T.
My requirement is that I need to shut down another of my own
applications - there must not be any need for user intervention. Basicly,
I want to do programaticly the same as going into Running Programs in
Settings on a PPC.
Thanks for the info and I accept your warnings, but at present it's the
only way I can find to do what I need.
Many thanks
Paul
Paul G. Tobey [eMVP] wrote:
You can enumerate all of the processes in the system with toolhelp
functions. I don't know what portion of those might be implemented in
SDF, but I think at least one or two were.
Don't forget that calling TerminateProcess is a very, very serious
matter and should be done only as a final resort, expecting the system
to be left in a semi-stable state.
Paul T.
message
Hi All
I've been looking at the OpenNetCF and it's Process Class - I see lots
of ways to start and control a process, but is there a way to kill a
process that was not started by you? By that, I mean that you don't
have a ProcessID, so GetProcessByID is out and there doesn't seemt to
be a way to get an ID from an application/window title.
Anyone have any suggestions?
Many thanks
Paul