<?

class Windows_control {

	static function find($caption) {
		$handle = User32::FindWindowA(null, $caption);
		return $handle;
	}

	static function close($handle) {
		$Pid = User32::NewFFIStruct('LPDWORD');
		User32::GetWindowThreadProcessId($handle, $Pid); // получаем PID процесса
		shell_exec("taskkill /PID {$Pid->pid}");
	}
}

?>