OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / Win32.cs
index 2d067b4..b624a83 100644 (file)
@@ -1,10 +1,52 @@
-using System.Runtime.InteropServices;\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
 {\r
     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
+\r
+        [DllImport("user32.dll")]\r
+        public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
+\r
+        public struct MEMORYSTATUS // Unused var's are required here.\r
+        {\r
+            public UInt32 dwLength;\r
+            public UInt32 dwMemoryLoad;\r
+            public UInt32 dwTotalPhys; // Used\r
+            public UInt32 dwAvailPhys;\r
+            public UInt32 dwTotalPageFile;\r
+            public UInt32 dwAvailPageFile;\r
+            public UInt32 dwTotalVirtual;\r
+            public UInt32 dwAvailVirtual;\r
+        }\r
+\r
+        [DllImport("kernel32.dll")]\r
+        public static extern void GlobalMemoryStatus\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