How to get the process name in C++

后端 未结 6 1071
陌清茗
陌清茗 2020-11-29 08:01

How do I get the process name from a PID using C++ in Windows?

6条回答
  •  孤城傲影
    2020-11-29 08:45

    You can obtain the process name by using the WIN32 API GetModuleBaseName after having the process handle. You can get the process handle by using OpenProcess.

    To get the executable name you can also use GetProcessImageFileName.

提交回复
热议问题