I've wrote that (for terminate calc.exe) ....
and it works !Code:#include <stdio.h> #include <stdlib.h> #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char * lpCmdLine, int nCmdShow) { HWND hWnd; DWORD procId; HANDLE hProc; if ( (hWnd = FindWindow ("SciCalc", "Calcolatrice")) && GetWindowThreadProcessId(hWnd, &procId)) { if ( hProc = OpenProcess (PROCESS_TERMINATE, FALSE, procId) ) { if ( TerminateProcess(hProc, 0) ) MessageBox (NULL, "CLOSED", NULL, 0); else MessageBox (NULL, "NOT CLOSED", NULL, 0); CloseHandle (hProc); } else MessageBox (NULL, "I CANT CLOSE", NULL, 0); } else MessageBox (NULL, "THE PROCESS WAS NOT FOUND", NULL, 0); return 0; }
now, 2 questions :
how can i find what to put in ("SciCalc", "Calcolatrice") ?? I put that coz i found it in a site but i want to have the 2 identificator for every exe that i want to close.
if i dont know anything but the dimension of the file ( of the exe ) can i terminate all the exe running that has that dimension?
thanx![]()
![]()



LinkBack URL
About LinkBacks





