怎样获取WINCE中所有运行的进程
void CModuleDlg::ListModules() { m_ctrlListModule.DeleteAllItems(); int i=0; CString re; BOOL bResult; HANDLE hSnap; MODULEENTRY32 me; me.dwSize=sizeof(me); hSnap=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,m_dwProcessID); unsigned short path[MAX_PATH]; for(bResult=Module32First(hSnap,&me);bResult;bResult=Module32Next(hSnap,&me)) { m_ctrlListModule.InsertItem(i,me.szModule); GetModuleFileName(me.hModule,path,MAX_PATH); m_ctrlListModule.SetItemText(i,1,path); re.Format(L"%X",me.modBaseAddr); m_ctrlListModule.SetItemText(i,2,re); i++; } CloseToolhelp32Snapshot(hSnap); }
|