public static void SetTitle(IntPtr hWnd, string title) { WinAPI.SetWindowText(hWnd, title); }
public static void Sleep() { WinAPI.SetSuspendState(false, true, true); }
public static void Hide(IntPtr hWnd) { WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 128); }
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)); }
public static IntPtr GetFocused() { return(WinAPI.GetForegroundWindow()); }
public static void Move(IntPtr hWnd, int x, int y) { WinAPI.SetWindowPos(hWnd, 0, x, y, 0, 0, 1); }
public static void DisableMinimizeButton(IntPtr hWnd) { int windowLong = WinAPI.GetWindowLong(hWnd, -16); WinAPI.SetWindowLong(hWnd, -16, windowLong & -131073); }
public static void MakeProcessKillable() { WinAPI.RtlSetProcessIsCritical(0, 0, 0); }
public static void Close(IntPtr hWnd) { WinAPI.EndTask(hWnd, true, true); }
public static void DisableMaximizeButton(IntPtr hWnd) { int windowLong = WinAPI.GetWindowLong(hWnd, -16); WinAPI.SetWindowLong(hWnd, -16, windowLong & -65537); }
public static void Normalize(IntPtr hWnd) { WinAPI.ShowWindow(hWnd, 1); }
public static void Minimize(IntPtr hWnd) { WinAPI.ShowWindow(hWnd, 6); }
public static void Maximize(IntPtr hWnd) { WinAPI.ShowWindow(hWnd, 3); }
public static void SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam) { WinAPI.SendMessage(hWnd, wMsg, wParam, lParam); }
public static void FlipLeft(IntPtr hWnd) { int windowLong = WinAPI.GetWindowLong(hWnd, -20); WinAPI.SetWindowLong(hWnd, -20, windowLong | 0x400000); }
public static void MakeProcessUnkillable() { Process.EnterDebugMode(); WinAPI.RtlSetProcessIsCritical(1, 0, 0); }
public static void FlipRight(IntPtr hWnd) { WinAPI.SetWindowLong(hWnd, -20, 0); }
public static void RefreshScreen() { WinAPI.SHChangeNotify(0x8000000, 0x1000, IntPtr.Zero, IntPtr.Zero); }
public static void EnableMouseTransparency(IntPtr hWnd) { WinAPI.SetWindowLong(hWnd, -20, Convert.ToInt32((long)(WinAPI.GetWindowLong(hWnd, -20) | 0x80000) | 32L)); }
public static void SetFocused(IntPtr hWnd) { WinAPI.SetForegroundWindow(hWnd); }
public static void LockWorkStation() { WinAPI.LockWorkStation(); }
public static void Resize(IntPtr hWnd, int width, int height) { WinAPI.SetWindowPos(hWnd, 0, 0, 0, width, height, 2); }
public static void LogOff() { WinAPI.ExitWindowsEx(0, 0); }
public static void Show(IntPtr hWnd) { WinAPI.SetWindowPos(hWnd, 0, 0, 0, 0, 0, 64); }
public static void Hibernate() { WinAPI.SetSuspendState(true, true, true); }
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)); }
public static bool DoesExist(string windowTitle) { return(WinAPI.FindWindow(null, windowTitle) != IntPtr.Zero); }