internal WinPosition(NativeMethods.WINDOWINFO wti) { this.Left = wti.rcClient.left; this.Top = wti.rcClient.top; this.Right = wti.rcClient.right; this.Bottom = wti.rcClient.bottom; }
internal static WinPosition GetWindowPosition(IntPtr wnd) { NativeMethods.WINDOWINFO wi = new NativeMethods.WINDOWINFO(); wi.cbSize = (uint) Marshal.SizeOf(wi); bool result = NativeMethods.GetWindowInfo(wnd, ref wi); MoniterInfo.MONITORINFOEX m = MoniterInfo.GetDesktopBoundsForWindow(wnd); WinPosition winpos = result ? new WinPosition(wi) : new WinPosition(); return winpos; }