It is not "Call of Duty(R): Black Ops II - Zombies", but "Call of Duty®: Black Ops II - Zombies".
#include <windows.h>
#include <iostream>
int main()
{
using namespace std;
int compteur_un = 0;
int compteur_deux = 0;
bool boucle = true;
system("title Black Ops 2 Trainer");
cout << "Trainer Black Ops 2 Zombie" << endl;
HWND hWnd = FindWindow(0, "Call of Duty(R): Black Ops II - Zombies"); //Don't find the window
if(hWnd == 0)
{
MessageBox(0, "Can't find window.", "Erreur", MB_OK|MB_ICONERROR);
}
else
{
DWORD proccess_ID;
GetWindowThreadProcessId(hWnd, &proccess_ID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proccess_ID);
if(!hProcess)
{
MessageBox(0, "Can't open the process", "Erreur!", MB_OK|MB_ICONERROR);
}
return 0;
}
Help me please.
It is not "Call of Duty(R): Black Ops II - Zombies", but "Call of Duty®: Black Ops II - Zombies".
No problem, but I really thought it would not detect the window because of the ® symbol. If you have any problem with it, you can use this instead:
So with this you would detect the class name of the window instead of the window title, and it would also work for Singleplayer + Multiplayer without any problem.Code:HWND hWnd = FindWindow("CoDBlackOps", 0);
Take a look at this:
We wanted to find the window name, not the class name, that's why we put 0.Code:HWND WINAPI FindWindow( _In_opt_ LPCTSTR lpClassName, _In_opt_ LPCTSTR lpWindowName );
/requestlock
Last edited by xVIRUZx; 08-30-2013 at 01:43 PM.