Solved how to find running processes in c++

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

UltimateHax

Newbie
Jan 22, 2017
2
764
0
Newer to gamehacking so go easy on me...


Hey thanks for clicking on my thread I was just wondering how would I go about finding a running process or window in c++, thanks.
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,149
78,998
2,395
Get process by executable name rather than window name:

C++:
DWORD GetProcID(wchar_t * exeName)
{
	PROCESSENTRY32 procEntry = { 0 };
	HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);

	if (!hSnapshot)
	{
		return 0;
	}

	procEntry.dwSize = sizeof(procEntry);

	if (!Process32First(hSnapshot, &procEntry))
	{
		return 0;
	}

	do
	{
		if (!wcscmp(procEntry.szExeFile, exeName))
		{
			CloseHandle(hSnapshot);
			return procEntry.th32ProcessID;
		}

	} while (Process32Next(hSnapshot, &procEntry));

	CloseHandle(hSnapshot);
	return 0;
}
C++:
DWORD dwProcID = GetProdID("ac_client.exe");

HANDLE gameHandle = OpenProcess(PROCESS_ALL_ACCESS | PROCESS_QUERY_INFORMATION, NULL, dwProcID );
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
Hello sir, first of all welcome to the site!
We actually have several tutorials on here that cover just that and countless other threads that cover this exact topic.
Make use of the search function on the forums and check out the GH Video Section for a buttload of tutorials to get you started :)
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods