OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / Win32.cs
1 using System;\r
2 using System.Runtime.InteropServices;\r
3 \r
4 namespace Handbrake.Functions\r
5 {\r
6     class Win32\r
7     {\r
8         [DllImport("user32.dll")]\r
9         public static extern int SetForegroundWindow(int hWnd);\r
10 \r
11         [DllImport("user32.dll")]\r
12         public static extern void LockWorkStation();\r
13 \r
14         [DllImport("user32.dll")]\r
15         public static extern int ExitWindowsEx(int uFlags, int dwReason);\r
16 \r
17         public struct MEMORYSTATUS // Unused var's are requred here.\r
18         {\r
19             public UInt32 dwLength;\r
20             public UInt32 dwMemoryLoad;\r
21             public UInt32 dwTotalPhys; // Used\r
22             public UInt32 dwAvailPhys;\r
23             public UInt32 dwTotalPageFile;\r
24             public UInt32 dwAvailPageFile;\r
25             public UInt32 dwTotalVirtual;\r
26             public UInt32 dwAvailVirtual;\r
27         }\r
28 \r
29         [DllImport("kernel32.dll")]\r
30         public static extern void GlobalMemoryStatus\r
31         (\r
32             ref MEMORYSTATUS lpBuffer\r
33         );\r
34     }\r
35 }\r