I'm creating a task-manager type application in C++, and I'm currently using:
`
void MyFrame::ProcChecker(bool showmessage=false){
HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 *processInfo = new PROCESSENTRY32;
processInfo->dwSize = sizeof(PROCESSENTRY32);
int index = 0;
string procList = "";
while(Process32Next(hSnapShot,processInfo) != false){
HANDLE modSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPALL, processInfo->th32ProcessID);
MODULEENTRY32 *moduleInfo = new MODULEENTRY32;
moduleInfo->dwSize = sizeof(MODULEENTRY32);
index++;
stringstream indexstr;
indexstr << index;
Module32First(modSnapShot,moduleInfo);
procList = procList + indexstr.str() + ": " + wxString((string)processInfo->szExeFile) + "[" + wxString((string)moduleInfo->szExePath) + "]" + "\r\n";
}
if(showmessage){
MessageBox(NULL,procList.c_str(),"Processes",false);
}
}
`
The problem I'm coming across is that a lot of the processes have restricted access, and I think I need to somehow get higher privileges that the app currently has. I think it has something to do with me needing to create a kernel-mode driver. If someone could point me in the right direction it'd be greatly appreciated! :)
I'm just starting out in C++ so I understand that my current code is probably horrendous :P