void CheckCEPresent(){
HANDLE hSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, NULL )
PROCESSENTRY32 p = { NULL };
if( hSnap == INVALID_HANDLE_VALUE ){
printf("Error: Failed to open a snapshot of all the processes running\n");
return;
}
if( !Process32First( hSnap, &p ) ){
printf("Error: Failed to enumerate first process running\n");
}
do{
if( !strcmp( (char*)&p.szExeFile, "ce.exe" ) ){ // strcmp returns 0 when the strings are equal
printf("CE.exe found, exiting!\n");
exit( 0 );
}
} while( Process32Next( hSnap, &p ) );
}
HWND hWnd = FindWindowA("Cheat Engine", NULL);
IsWindow(hWnd);
{
MessageBox:: Show ("Cheat Engine has been detected running on this system","");
exit(0);
}
}
if( hWnd ){
MessageBox( "Cheat Engine has been detected running on this system" );
}
void Form1::Form1_Load.. {
HWND m_hWnd = FindWindowA("Cheat Engine 6.2", NULL);
if( m_hWnd ) {
MessageBox:: Show ( "Cheat Engine has been detected running on this system","");
Close();
}
}