private static extern bool AdjustWindowRectEx(ref Win32Rectangle lpRect, WindowStyle dwStyle, bool bMenu, ExtendedWindowStyle dwExStyle);
public static Rectangle AdjustWindowRectEx(int width, int height, WindowStyle style, bool menu, ExtendedWindowStyle extendedStyle) { var rect = new Win32Rectangle { Right = width, Bottom = height }; AdjustWindowRectEx(ref rect, style, menu, extendedStyle); return rect.ToRectangle(); }