Пример #1
0
 public static void SetTitle(IntPtr hWnd, string title)
 {
     WinAPI.SetWindowText(hWnd, title);
 }
Пример #2
0
 public static void Sleep()
 {
     WinAPI.SetSuspendState(false, true, true);
 }
Пример #3
0
 public static void Hide(IntPtr hWnd)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 128);
 }
Пример #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));
 }
Пример #5
0
 public static IntPtr GetFocused()
 {
     return(WinAPI.GetForegroundWindow());
 }
Пример #6
0
 public static void Move(IntPtr hWnd, int x, int y)
 {
     WinAPI.SetWindowPos(hWnd, 0, x, y, 0, 0, 1);
 }
Пример #7
0
        public static void DisableMinimizeButton(IntPtr hWnd)
        {
            int windowLong = WinAPI.GetWindowLong(hWnd, -16);

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

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

            WinAPI.SetWindowLong(hWnd, -20, windowLong | 0x400000);
        }
Пример #16
0
 public static void MakeProcessUnkillable()
 {
     Process.EnterDebugMode();
     WinAPI.RtlSetProcessIsCritical(1, 0, 0);
 }
Пример #17
0
 public static void FlipRight(IntPtr hWnd)
 {
     WinAPI.SetWindowLong(hWnd, -20, 0);
 }
Пример #18
0
 public static void RefreshScreen()
 {
     WinAPI.SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero);
 }
Пример #19
0
 public static void EnableMouseTransparency(IntPtr hWnd)
 {
     WinAPI.SetWindowLong(hWnd, -20, Convert.ToInt32((long)(WinAPI.GetWindowLong(hWnd, -20) | 0x80000) | 32L));
 }
Пример #20
0
 public static void SetFocused(IntPtr hWnd)
 {
     WinAPI.SetForegroundWindow(hWnd);
 }
Пример #21
0
 public static void LockWorkStation()
 {
     WinAPI.LockWorkStation();
 }
Пример #22
0
 public static void Resize(IntPtr hWnd, int width, int height)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, width, height, 2);
 }
Пример #23
0
 public static void LogOff()
 {
     WinAPI.ExitWindowsEx(0, 0);
 }
Пример #24
0
 public static void Show(IntPtr hWnd)
 {
     WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 64);
 }
Пример #25
0
 public static void Hibernate()
 {
     WinAPI.SetSuspendState(true, true, true);
 }
Пример #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));
 }
Пример #27
0
 public static bool DoesExist(string windowTitle)
 {
     return(WinAPI.FindWindow(null, windowTitle) != IntPtr.Zero);
 }