Very good, lately I am having problems when trying to kill any process in C ++. And this is the code:
#include <Windows.h>
#include <stdio.h>
#include <iostream>
using namespace std;
DWORD pid;
int main(){
HWND Ventana = FindWindowA(NULL, ("CORRER"));
GetWindowThreadProcessId(Ventana, &pid);
cout << "Este es el proceso que esta corriendo" << pid << endl;
system("pause");
TerminateProcess(&pid, 0);
system("pause");
return 0;
}
Now, I have another program programmed in C ++ that is called "running" (without the quotes), the program that tries to kill the process detects its PID, but TerminateProcess does not kill the process. It does not give me any errors when compiling.
Thank you very much for all the possible help.