How to get process id given the process name
-
Hi, From within my application i need to wait for an external process to complete before proceeding. But all i have is the external process's name. Is there any API that returns the process id or handle given the process name ?? I tried using CreateToolhelp32Snapshot but it does not seem to work in VC41 in which my application is built. It works fine in VC6 though. Thanks for ur help.
-
Hi, From within my application i need to wait for an external process to complete before proceeding. But all i have is the external process's name. Is there any API that returns the process id or handle given the process name ?? I tried using CreateToolhelp32Snapshot but it does not seem to work in VC41 in which my application is built. It works fine in VC6 though. Thanks for ur help.
You can not to get the Handle of the process from the process name, you need to do the contrary. You must to enum the process handles or Ids and the get the process name You need to use the psapi.dll library. You must to use the EnumProcessModules function and then the GetModuleFileNameEx function to get the filename of each process. Regards Carlos Antollini Do you know piFive[^] ?
-
You can not to get the Handle of the process from the process name, you need to do the contrary. You must to enum the process handles or Ids and the get the process name You need to use the psapi.dll library. You must to use the EnumProcessModules function and then the GetModuleFileNameEx function to get the filename of each process. Regards Carlos Antollini Do you know piFive[^] ?