Código: Seleccionar todo

//process killer by crAcker
#include <windows.h>
#include <iostream>
#include <tlhelp32.h>

using namespace std;


HANDLE hProcessSnap;
HANDLE hProcess;

PROCESSENTRY32 pe32;

char Report[6];

BOOL KillProcess(char *Process)
{
	 hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
	
	 pe32.dwSize = sizeof(PROCESSENTRY32);
		
	 Process32First(hProcessSnap, &pe32);
		
	 while(Process32Next(hProcessSnap, &pe32))
	 {
		if(!strcmp(pe32.szExeFile, Process))
		{
		   strcpy(Report, "Found");
								  
		   hProcess = OpenProcess(PROCESS_TERMINATE, 0, pe32.th32ProcessID);
		  
		   if(TerminateProcess(hProcess, 0) == 0)
		   {
			   cout<<"process failed.......";
			   cin.get();
		   }
		   else
		   {
			   cout<<"process terminated.....";
			   cin.get();
		   }
		}
	 }
		
	 CloseHandle(hProcess);
	 CloseHandle(hProcessSnap);
	
	 if(strcmp(Report, "Found"))
	 cout<<"the process isn't open u moron!";
	 cin.get();
	
	 strcpy(Report, "");

	 return 0;
}



int main()
{
	
   	char* process[10];

	cout<<"Enter name of process: ";
	cin>>process[10];
	KillProcess(process[10]);
	return 0;	
	
}
Welcome to your nightmare, bitch.
Responder

Volver a “Otros lenguajes”