How to check if a process is running or not using C++

前端 未结 3 1360
情书的邮戳
情书的邮戳 2021-01-14 21:28

I should not display certain context menu options if one process is not running?. I am checking if the process is running or not using the process name.

But the iss

3条回答
  •  死守一世寂寞
    2021-01-14 21:59

    EnumProcesses is the other way to enumerate active processes.

    The difference is that you need to allocate the space for PIDs,call EnumProcesses, open each process with PROCESS_QUERY_INFORMATION access flag and then call GetProcessImageFileName on it's handle and do the comparison.

提交回复
热议问题