📄 proclist.cpp
字号:
/********************************************************************
Copyright (c) Beijing Feitian Technologies
http://www.FTSafe.com
File : proclist.cpp
Created: 2003/11/05
Author: yihai
Purpose: ?
Revision: ?
*********************************************************************/
// proclist.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
#include <TLHELP32.H>
#include <CONIO.H>
BOOL ProcList()
{
HANDLE hProcessSnap = NULL;
BOOL bRet = FALSE;
PROCESSENTRY32 pe32 = {0};
// Take a snapshot of all processes in the system.
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hProcessSnap == INVALID_HANDLE_VALUE)
return (TRUE);
// Fill in the size of the structure before using it.
pe32.dwSize = sizeof(PROCESSENTRY32);
// Walk the snapshot of the processes, and for each process,
// display information.
if (Process32First(hProcessSnap, &pe32))
{
do
{
printf("(%X-%X) %s\n",pe32.th32ParentProcessID,pe32.th32ProcessID,pe32.szExeFile);
}
while (Process32Next(hProcessSnap, &pe32));
bRet = TRUE;
}
else
bRet = FALSE;
CloseHandle (hProcessSnap);
return (bRet);
}
int main(int argc, char* argv[])
{
ProcList();
getch();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -