internal void ToNative(ref RECT rect) { rect.top = (int)Top; rect.bottom = (int)Bottom; rect.left = (int)Left; rect.right = (int)Right; }
internal static Position FromNative(ref RECT rect) { Position position = new Position() { Top = rect.top, Bottom = rect.bottom, Left = rect.left, Right = rect.right }; position.Height = position.Bottom - position.Top; position.Width = position.Right - position.Left; return position; }
public static extern int GetWindowRect(IntPtr hwnd, out RECT rc);
public static RECT GetWindowRect(IntPtr handle) { RECT rect = new RECT(); NativeMethods.GetWindowRect(handle, out rect); return rect; }