Пример #1
0
 public static void GenerateCtrlEvent(ConsoleExCtrlEventType Event, uint ProcessGroupId)
 {
     if (!WinAPI.GenerateConsoleCtrlEvent(Event, ProcessGroupId))
     {
         throw new ConsoleExException("ConsoleEx: Unable to generate a control event.");
     }
 }
Пример #2
0
        static bool CtrlHandlerFunction(ConsoleExCtrlEventType CtrlType)
        {
            if (ConsoleControlEvent != null)
            {
                ConsoleControlEventHandlerArgs Events = new ConsoleControlEventHandlerArgs(CtrlType);
                OnConsoleControlEvent(Events);

                return(Events.CancelProcessing);
            }

            return(false);
        }
Пример #3
0
 static public extern bool GenerateConsoleCtrlEvent(ConsoleExCtrlEventType dwCtrlEvent, uint ProcessGroupId);
Пример #4
0
 public ConsoleControlEventHandlerArgs(ConsoleExCtrlEventType NewEventType)
 {
     EventType = NewEventType;
 }