class Win32\r
{\r
[DllImport("user32.dll")]\r
- public static extern int SetForegroundWindow(int hWnd);\r
+ public static extern bool SetForegroundWindow(int hWnd);\r
\r
[DllImport("user32.dll")]\r
public static extern void LockWorkStation();\r
[DllImport("user32.dll")]\r
public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
\r
- public struct MEMORYSTATUS // Unused var's are requred here.\r
+ public struct MEMORYSTATUS // Unused var's are required here.\r
{\r
public UInt32 dwLength;\r
public UInt32 dwMemoryLoad;\r
(\r
ref MEMORYSTATUS lpBuffer\r
);\r
+\r
+ [DllImport("kernel32.dll", SetLastError = true)]\r
+ public static extern bool GenerateConsoleCtrlEvent(ConsoleCtrlEvent sigevent, int dwProcessGroupId);\r
+\r
+ public enum ConsoleCtrlEvent\r
+ {\r
+ CTRL_C = 0,\r
+ CTRL_BREAK = 1,\r
+ CTRL_CLOSE = 2,\r
+ }\r
}\r
}\r