Procedure KillProgram (ClassName: String; WindowTitle: String);
Const
Process_terminate = $ 0001;
VAR
PROCESSHANDLE: THANDLE;
ProcessID: integer;
Thewindow: hwnd;
Begin
TheWindow: = FindWindow (Classname, WindowTertle);
GetWindowThreadProcessid (theWindow, @ProcessID);
ProcessHandle: = OpenProcess (Process_Terminate, False, ProcessID);
TerminateProcess (ProcessHandle, 4);
END;