// Get the adjustment values for a top-level window, to convert // between window bounds and client bounds. Each value should // be >= 0 and indicate the number of pixels to subtract from the // windows bounds to get the client bounds. public void GetWindowAdjust(out int leftAdjust, out int topAdjust, out int rightAdjust, out int bottomAdjust, ToolkitWindowFlags flags) { Win32.Api.WindowStyle style; Win32.Api.WindowsExtendedStyle extendedStyle; GetWin32StylesFromFlags(flags, out style, out extendedStyle); Win32.Api.RECT rect = new System.Drawing.Win32.Api.RECT(0, 0, 0, 0); Win32.Api.AdjustWindowRectEx(ref rect, style, false, extendedStyle); leftAdjust = -rect.left; topAdjust = -rect.top; rightAdjust = rect.right; bottomAdjust = rect.bottom; }
// Get the adjustment values for a top-level window, to convert // between window bounds and client bounds. Each value should // be >= 0 and indicate the number of pixels to subtract from the // windows bounds to get the client bounds. public void GetWindowAdjust(out int leftAdjust, out int topAdjust, out int rightAdjust, out int bottomAdjust, ToolkitWindowFlags flags) { Win32.Api.WindowStyle style; Win32.Api.WindowsExtendedStyle extendedStyle; GetWin32StylesFromFlags( flags, out style, out extendedStyle); Win32.Api.RECT rect = new System.Drawing.Win32.Api.RECT(0,0,0,0); Win32.Api.AdjustWindowRectEx( ref rect, style, false, extendedStyle ); leftAdjust = -rect.left; topAdjust = -rect.top; rightAdjust = rect.right; bottomAdjust = rect.bottom; }