64,654
社区成员
发帖
与我相关
我的任务
分享
CString str=_T(""),str1=_T(""),str2=_T("");
TCHAR a[100]=_T("");
HANDLE handle0=::OpenProcess(PROCESS_ALL_ACCESS,FALSE,arrayin[m]);
DWORD cbNeededModule =0;
HMODULE hMods[100]={0};
char szModuleName[100]={0};
//HANDLE handle0=::OpenProcess(PROCESS_VM_READ,FALSE,arrayin[m]);
// 枚举进程模块信息
::EnumProcessModules(handle0, hMods, sizeof(hMods), &cbNeededModule);
// 取得主模块全名,每个进程的第一模块即为进程主模块,这里使用ANSI版
::GetModuleFileNameExA(handle0,hMods[0],szModuleName,sizeof(szModuleName)) ;
//::GetModuleFileNameExA(handle0,NULL,szModuleName,sizeof(szModuleName)) ;
str.Format(L"%d",arrayin[m]);
//str1.Format(L"%s",szModuleName);
str1=szModuleName;
int pos=str1.ReverseFind(L'\\');
str2=str1.Mid(pos+1,str1.GetLength());
str.Append(L" ");
str.Append(str2);
listbox.AddString(str);
::CloseHandle(handle0);