Exemple #1
0
void close_external(External_Process ** epp)
{
	External_Process *ep = *epp;
	BOOL rc;

	rc = GenerateConsoleCtrlEvent(CTRL_C_EVENT, ep->pid);
	if (!rc) {
		/* The console control event will fail for the winamp 
		   plugin.  Therefore, no choice but to kill 
		   the process using TerminateProcess()... */
		debug_print_error();
		debug_printf("rc = %d, gle = %d\n", rc, GetLastError());
		rc = TerminateProcess(ep->hproc, 0);
		debug_printf("Terminated process: %d\n", rc);
	}
	CloseHandle(ep->hproc);

	free(ep);
	*epp = 0;
}
	static void glib_message_handler(const gchar* log_domain, GLogLevelFlags log_level,
			const gchar* message, gpointer user_data)
	{
		// log_domain is already printed as part of message.
		debug_print_error("gtk", "%s\n", message);
	}