-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
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