CreateToolhelp32Snapshot API MSDN 주소
- https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot
CreateToolhelp32Snapshot function (tlhelp32.h) - Win32 apps
Takes a snapshot of the specified processes, as well as the heaps, modules, and threads used by these processes.
docs.microsoft.com
Process32First API MSDN 주소
- https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32first
Process32First function (tlhelp32.h) - Win32 apps
Retrieves information about the first process encountered in a system snapshot.
docs.microsoft.com
Process32Next API MSDN 주소
- https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32next
Process32Next function (tlhelp32.h) - Win32 apps
Retrieves information about the next process recorded in a system snapshot.
docs.microsoft.com
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <TlHelp32.h>
int main(void)
{
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hSnapshot != INVALID_HANDLE_VALUE)
{
PROCESSENTRY32 pe32 = { sizeof(PROCESSENTRY32) };
if (Process32First(hSnapshot, &pe32))
{
do
{
printf("PID : %6d, Process Name : %s\n", pe32.th32ProcessID, pe32.szExeFile);
} while (Process32Next(hSnapshot, &pe32));
}
CloseHandle(hSnapshot);
}
return 0;
}
'Windows Programming > Windows API' 카테고리의 다른 글
Local Host PC IP 주소 가져오기 - 2 (0) | 2021.11.22 |
---|---|
Local Host PC IP 주소 가져오기 (gethostbyname API) (0) | 2021.11.22 |
윈도우 드라이브 정보 가져오기 (QueryDosDevice API) (0) | 2021.08.06 |
윈도우 전체 사용자 목록 및 전체 사용자 SID 얻기 (0) | 2021.08.06 |
윈도우 시스템 이름 얻어오기 (GetHostName API) (0) | 2021.08.06 |