summaryrefslogtreecommitdiffstats
path: root/win/C#/Functions/Win32.cs
diff options
context:
space:
mode:
Diffstat (limited to 'win/C#/Functions/Win32.cs')
-rw-r--r--win/C#/Functions/Win32.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/win/C#/Functions/Win32.cs b/win/C#/Functions/Win32.cs
index 2bc47e619..bf0bde69c 100644
--- a/win/C#/Functions/Win32.cs
+++ b/win/C#/Functions/Win32.cs
@@ -6,7 +6,7 @@ namespace Handbrake.Functions
class Win32
{
[DllImport("user32.dll")]
- public static extern int SetForegroundWindow(int hWnd);
+ public static extern bool SetForegroundWindow(int hWnd);
[DllImport("user32.dll")]
public static extern void LockWorkStation();
@@ -14,7 +14,7 @@ namespace Handbrake.Functions
[DllImport("user32.dll")]
public static extern int ExitWindowsEx(int uFlags, int dwReason);
- public struct MEMORYSTATUS // Unused var's are requred here.
+ public struct MEMORYSTATUS // Unused var's are required here.
{
public UInt32 dwLength;
public UInt32 dwMemoryLoad;
@@ -31,5 +31,15 @@ namespace Handbrake.Functions
(
ref MEMORYSTATUS lpBuffer
);
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ public static extern bool GenerateConsoleCtrlEvent(ConsoleCtrlEvent sigevent, int dwProcessGroupId);
+
+ public enum ConsoleCtrlEvent
+ {
+ CTRL_C = 0,
+ CTRL_BREAK = 1,
+ CTRL_CLOSE = 2,
+ }
}
}