15,471
社区成员
发帖
与我相关
我的任务
分享
DWORD dwProcessId,needed;
HMODULE hModule;
char path[256];
::GetWindowThreadProcessId(hwnd,&dwProcessId);
HANDLE hProcess = ::OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,false,dwProcessId);
CString strPath ;
if (hProcess)
{
EnumProcessModules(hProcess, &hModule, sizeof(hModule), &needed);
GetModuleFileNameEx(hProcess, hModule, path, sizeof(path));
AfxMessageBox(path);
strPath.Format("%s",path);
}else{
AfxMessageBox("无法搜索CF目录");
}