Advertisement
Guest User

Untitled

a guest
Jul 5th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. void GetProcName()
  2. {
  3.     HANDLE snapHandle = GetCurrentProcess();
  4.     PROCESSENTRY32 processEntry = { 0 };
  5.     if ((snapHandle = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)) == INVALID_HANDLE_VALUE) {
  6.         return;
  7.     }
  8.     processEntry.dwSize = sizeof(PROCESSENTRY32);
  9.     if (Process32First(snapHandle, &processEntry))
  10.     {
  11.         while (Process32Next(snapHandle, &processEntry))
  12.         {
  13.             cout << processEntry.szExeFile << endl;
  14.         }
  15.     }
  16.     return;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement