HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS,FALSE,pe32.th32ProcessID);
TCHAR pBuffer[MAX_PATH+1];
GetModuleFileNameEx(hProcess,NULL,pBuffer,MAX_PATH+1);//直接使用GetModuleFileNameEx函数获取进程文件路径
printf("file name is: %ls\n\n",pBuffer);
HANDLE hprocess=::OpenProcess(PROCESS_ALL_ACCESS,FALSE,pe32.th32ProcessID);
if(hprocess!=NULL)
{
::TerminateProcess(hprocess,0);//关闭进程
printf("I have close the process you choose!\n");
::CloseHandle(hprocess);
}
}