include <Windows.h>
include <stdio.h>
include <TlHelp32.h>
int main()
{
HANDLE hProceessnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hProceessnap == INVALID_HANDLE_VALUE)
{
printf_s("创建进行快照失败\n");
return -1;
}
else
{
PROCESSENTRY32 pe32;
pe32.dwSize = sizeof(pe32);
BOOL hProcess = Process32First(hProceessnap, &pe32);
char buff[1024];
while (hProcess)
{
wsprintf(buff, "进程名:%s--------------------进程ID:%d", pe32.szExeFile, pe32.th32ParentProcessID);
printf_s("%s\n", buff);
memset(buff, 0x00, 1024);
hProcess = Process32Next(hProceessnap, &pe32);
}
}
CloseHandle(hProceessnap);
return 0;
}
来源:https://blog.csdn.net/qq78442761/article/details/54646010
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询