public RECT(RECT rcSrc) { this.left = rcSrc.left; this.top = rcSrc.top; this.right = rcSrc.right; this.bottom = rcSrc.bottom; }
public bool Equals(RECT r) { return r.Left == Left && r.Top == Top && r.Right == Right && r.Bottom == Bottom; }
static extern bool GetWindowRect(int hWnd, out RECT lpRect);
private static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);
static extern bool GetClientRect(IntPtr hWnd, ref RECT rect);
/// <summary> /// Gets the Console Window location and size in pixels /// </summary> public void GetWindowPosition(out int x, out int y, out int width, out int height) { RECT rect = new RECT(); GetClientRect(Handle, ref rect); x = rect.top; y = rect.left; width = rect.right - rect.left; height = rect.bottom - rect.top; }
public RECT(RECT rcSrc) { m_left = rcSrc.m_left; m_top = rcSrc.m_top; m_right = rcSrc.m_right; m_bottom = rcSrc.m_bottom; }
public MONITORINFO() { m_cbSize = Marshal.SizeOf(typeof(MONITORINFO)); m_rcMonitor = new RECT(); m_rcWork = new RECT(); m_dwFlags = 0; }
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, ref RECT rect);
private void MoveSelfToForeground() { IntPtr handle = Process.GetCurrentProcess().MainWindowHandle; RECT chromeRect = new RECT(); GetWindowRect(this.ChromeProcess.MainWindowHandle, ref chromeRect); RECT nCorderRect = new RECT(); GetWindowRect(handle, ref nCorderRect); int newX = 20; int newY = chromeRect.bottom - (nCorderRect.bottom - nCorderRect.top) - 20; SetWindowPos(handle, new IntPtr(-1), newX, newY, 0, 0, (0x0001)); }
public static extern long GetWindowRect(IntPtr hWnd, ref RECT lpRect);
public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
private static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect);