Board index » cppbuilder » OpenProcess and Process ID

OpenProcess and Process ID


2004-09-02 01:57:36 AM
cppbuilder83
I want to terminate a process that shows up as "WINWORD.EXE" in the
taskmanger
How can I do that programmatically ?
That's for a cleanup in case of an OLE error.
"WINWORD.EXE" was started by OLE.
I found TerminateProcess() and OpenProcess()
But I need a Process ID for "WINWORD.EXE". - how do I get it?
Roland
 
 

Re:OpenProcess and Process ID

"roladdon" < XXXX@XXXXX.COM >wrote in message
Quote
I want to terminate a process that shows up
as "WINWORD.EXE" in the taskmanger
How can I do that programmatically ?
You have to first fine the running process that belongs to that executable
file. Look at the following article for details on how to do that:
How To Enumerate Applications Using Win32 APIs
support.microsoft.com/default.aspx
Once you find the process, you will also have its ID available as well.
Gambit
 

Re:OpenProcess and Process ID

Thanks - it Works !
The sample works in CBuilder on WinXP as is!
(no need to install an extra headers or dlls)
Thanks
Roland
 

{smallsort}