OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / Win32.cs
index 2bc47e6..b624a83 100644 (file)
@@ -1,4 +1,11 @@
-using System;\r
+/*  win32.cs $\r
+       \r
+          This file is part of the HandBrake source code.\r
+          Homepage: <http://handbrake.fr>.\r
+          It may be used under the terms of the GNU General Public License. */\r
+\r
+\r
+using System;\r
 using System.Runtime.InteropServices;\r
 \r
 namespace Handbrake.Functions\r
@@ -6,7 +13,7 @@ namespace Handbrake.Functions
     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
@@ -14,7 +21,7 @@ namespace Handbrake.Functions
         [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
@@ -31,5 +38,15 @@ namespace Handbrake.Functions
         (\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