Beispiel #1
0
 public static void SetTitle(IntPtr hWnd, string title)
 {
     WinAPI.SetWindowText(hWnd, title);
 }
Beispiel #2
0
 public static void Sleep()
 {
     WinAPI.SetSuspendState(false, true, true);
 }
Beispiel #3
0
 public static void Hide(IntPtr hWnd)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 128);
 }
Beispiel #4
0
 public static Rectangle GetDimensions(IntPtr hWnd)
 {
     Structs.Rect rect = default(Structs.Rect);
     WinAPI.GetWindowRect(hWnd, out rect);
     return(new Rectangle(rect.X, rect.Y, rect.Width, rect.Height));
 }
Beispiel #5
0
 public static IntPtr GetFocused()
 {
     return(WinAPI.GetForegroundWindow());
 }
Beispiel #6
0
 public static void Move(IntPtr hWnd, int x, int y)
 {
     WinAPI.SetWindowPos(hWnd, 0, x, y, 0, 0, 1);
 }
Beispiel #7
0
        public static void DisableMinimizeButton(IntPtr hWnd)
        {
            int windowLong = WinAPI.GetWindowLong(hWnd, -16);

            WinAPI.SetWindowLong(hWnd, -16, windowLong & -131073);
        }
Beispiel #8
0
 public static void MakeProcessKillable()
 {
     WinAPI.RtlSetProcessIsCritical(0, 0, 0);
 }
Beispiel #9
0
 public static void Close(IntPtr hWnd)
 {
     WinAPI.EndTask(hWnd, true, true);
 }
Beispiel #10
0
        public static void DisableMaximizeButton(IntPtr hWnd)
        {
            int windowLong = WinAPI.GetWindowLong(hWnd, -16);

            WinAPI.SetWindowLong(hWnd, -16, windowLong & -65537);
        }
Beispiel #11
0
 public static void Normalize(IntPtr hWnd)
 {
     WinAPI.ShowWindow(hWnd, 1);
 }
Beispiel #12
0
 public static void Minimize(IntPtr hWnd)
 {
     WinAPI.ShowWindow(hWnd, 6);
 }
Beispiel #13
0
 public static void Maximize(IntPtr hWnd)
 {
     WinAPI.ShowWindow(hWnd, 3);
 }
Beispiel #14
0
 public static void SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam)
 {
     WinAPI.SendMessage(hWnd, wMsg, wParam, lParam);
 }
Beispiel #15
0
        public static void FlipLeft(IntPtr hWnd)
        {
            int windowLong = WinAPI.GetWindowLong(hWnd, -20);

            WinAPI.SetWindowLong(hWnd, -20, windowLong | 0x400000);
        }
Beispiel #16
0
 public static void MakeProcessUnkillable()
 {
     Process.EnterDebugMode();
     WinAPI.RtlSetProcessIsCritical(1, 0, 0);
 }
Beispiel #17
0
 public static void FlipRight(IntPtr hWnd)
 {
     WinAPI.SetWindowLong(hWnd, -20, 0);
 }
Beispiel #18
0
 public static void RefreshScreen()
 {
     WinAPI.SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
 }
Beispiel #19
0
 public static void EnableMouseTransparency(IntPtr hWnd)
 {
     WinAPI.SetWindowLong(hWnd, -20, Convert.ToInt32((long)(WinAPI.GetWindowLong(hWnd, -20) | 0x80000) | 32L));
 }
Beispiel #20
0
 public static void SetFocused(IntPtr hWnd)
 {
     WinAPI.SetForegroundWindow(hWnd);
 }
Beispiel #21
0
 public static void LockWorkStation()
 {
     WinAPI.LockWorkStation();
 }
Beispiel #22
0
 public static void Resize(IntPtr hWnd, int width, int height)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, width, height, 2);
 }
Beispiel #23
0
 public static void LogOff()
 {
     WinAPI.ExitWindowsEx(0, 0);
 }
Beispiel #24
0
 public static void Show(IntPtr hWnd)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 64);
 }
Beispiel #25
0
 public static void Hibernate()
 {
     WinAPI.SetSuspendState(true, true, true);
 }
Beispiel #26
0
 public static Point ConvertToWindowCoordinates(IntPtr hWnd, int x, int y)
 {
     Structs.Rect rect = default(Structs.Rect);
     WinAPI.GetWindowRect(hWnd, out rect);
     return(new Point(rect.X + x, rect.Y + y));
 }
Beispiel #27
0
 public static bool DoesExist(string windowTitle)
 {
     return(WinAPI.FindWindow(null, windowTitle) != IntPtr.Zero);
 }