terminate a process 
Author Message
 terminate a process

Hi.  Can I terminate a process using it's module name alone?  I know how
to terminate a process if it has a window (FindWindow,
GetWindowThreadProcessId, OpenProcess, TerminateProcess), but what if
the program doesn't create a window?  I created two programs.  Program A
needs to close Program B at a certain time, but Program B doesn't create
a window.  I would rather find a way for Program A to close Program B
instead of changing Program B to work with the above method.  Thanks.


Sun, 14 Jul 2002 03:00:00 GMT  
 terminate a process

Quote:
>Hi.  Can I terminate a process using it's module name alone?  I know how
>to terminate a process if it has a window (FindWindow,
>GetWindowThreadProcessId, OpenProcess, TerminateProcess), but what if
>the program doesn't create a window?  I created two programs.  Program A
>needs to close Program B at a certain time, but Program B doesn't create
>a window.  I would rather find a way for Program A to close Program B
>instead of changing Program B to work with the above method.  Thanks.

Michael,

If both programs are under your control it'd be best if you used an
inter-process synchronisation method to have the program close down in
a controlled manner rather than by forcing it. Have a look at
"Synchronization" in the Platform SDK docs.

Dave
--
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Mon, 15 Jul 2002 03:00:00 GMT  
 terminate a process
The other way is enumerating the processes until you find B, but attention!
If the user renames the exe, you are finished.
The best (I think) way to enumerate processes is described here:

http://support.microsoft.com/support/kb/articles/q175/0/30.asp
It gives you a function which works on both 9x and NT.

Gabriele Trombetti



Quote:
> Hi.  Can I terminate a process using it's module name alone?  I know how
> to terminate a process if it has a window (FindWindow,
> GetWindowThreadProcessId, OpenProcess, TerminateProcess), but what if
> the program doesn't create a window?  I created two programs.  Program A
> needs to close Program B at a certain time, but Program B doesn't create
> a window.  I would rather find a way for Program A to close Program B
> instead of changing Program B to work with the above method.  Thanks.



Sun, 21 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Find and terminate a process under WIN98

2. How to terminate a process

3. Terminate the process using WaitableTimer

4. How to terminate a Process by Name ??

5. How to terminate a process?

6. Terminating a process

7. Terminate a process:

8. About terminate a process:

9. How to terminate a process created with CreateProcess(...)

10. Cannot terminate a process.

11. How to terminate a process?

12. Terminate a process?

 

 
Powered by phpBB® Forum Software