public static void GenerateCtrlEvent(ConsoleExCtrlEventType Event, uint ProcessGroupId) { if (!WinAPI.GenerateConsoleCtrlEvent(Event, ProcessGroupId)) { throw new ConsoleExException("ConsoleEx: Unable to generate a control event."); } }
static bool CtrlHandlerFunction(ConsoleExCtrlEventType CtrlType) { if (ConsoleControlEvent != null) { ConsoleControlEventHandlerArgs Events = new ConsoleControlEventHandlerArgs(CtrlType); OnConsoleControlEvent(Events); return(Events.CancelProcessing); } return(false); }
static public extern bool GenerateConsoleCtrlEvent(ConsoleExCtrlEventType dwCtrlEvent, uint ProcessGroupId);
public ConsoleControlEventHandlerArgs(ConsoleExCtrlEventType NewEventType) { EventType = NewEventType; }