Hello guys, i'm pretty new to c++ , i'm trying to make an zoom script for csgo but i can't get this working, it says PROCESS_ALL_ACCES not declared in this scope, but i declared it on the top outside the else loop, so this should be fine :s
can anyone help me with this please. i'm trying to do my best not copy pasting but now i'm hopeless atm i tried searching for a fix but didnt succeed to find one.
Thanks in advanced.
Code:
#include <iostream>
#include <windows.h>
#include <string>
#include <winuser.h>
using namespace std;
int main ()
{
int Newvalue = 40;
HANDLE handle;
HWND hwnd = FindWindowA(NULL, "Counter-Strike: Global Offensive");
if (hwnd == NULL)
{
cout << "Cannot find the window" << endl;
Sleep(3000);
exit(-1);
}
else
{
DWORD procID;
GetWindowThreadProcessId(hwnd,&procID);
handle = OpenProcess(PROCESS_ALL_ACCES, FALSE, procID);
if (procID == NULL)
{
cout << "cannot obtain process" << endl;
Sleep(3000);
exit(-1);
}
else
{
for (;;)
{
if (GetAsyncKeyState(0x25))
{
WriteProcessMemory(handle, (LPVOID)0x31D8, &Newvalue, sizeof(Newvalue),0);
Newvalue++;
}
Sleep(1);
}
}
}
return 0;
}