Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void GetProcName()
- {
- HANDLE snapHandle = GetCurrentProcess();
- PROCESSENTRY32 processEntry = { 0 };
- if ((snapHandle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE) {
- return;
- }
- processEntry.dwSize = sizeof(PROCESSENTRY32);
- if (Process32First(snapHandle, &processEntry))
- {
- while (Process32Next(snapHandle, &processEntry))
- {
- cout << processEntry.szExeFile << endl;
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement