#include
# include "tlhelp32. H"
BOOL GetProcessList ()
{
HANDLE hProcessSnap;
HANDLE hModuleSnap;
BOOL bRet=FALSE;
BOOL bModule=FALSE;
PROCESSENTRY32 pe32={0};
MODULEENTRY32 me32={0};
HProcessSnap=CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS, 0);
BRet=Process32First (hProcessSnap, & amp; Pe32);
While (bRet)
{
Printf (" % s \ n ", pe32 szExeFile);
HModuleSnap=CreateToolhelp32Snapshot (TH32CS_SNAPMODULE, 0);
BModule=Module32First (hModuleSnap, & amp; Me32);
While (bModule)
{
Printf (" % s \ n \ t, "me32. SzExePath);
}
BRet=Process32Next (hProcessSnap, & amp; Pe32);
}
The CloseHandle (hProcessSnap);
The CloseHandle (hModuleSnap);
Return TRUE;
}
Void main ()
{
GetProcessList ();
}
CodePudding user response:
To set breakpoints single-step debugging seeCreateToolhelp32Snapshot snapshot view the process module and thread
CodePudding user response:
Step through seems wrong, whyCodePudding user response:
Most of the API error can be get error code GetLastErrorSee the MSDN documentation in detail
CodePudding user response:
Not tlhelp32 notCodePudding user response:
Microsoft has to write good code, compare to knowhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms686701 (v=versus 85). Aspx
CodePudding user response:
You didn't finish writing the code, so there is no list.