/** * In windows the user can customize the border and title bar size. * * @return border thickness in pixels */ public static int getBorderSize() { int f = User32.INSTANCE.GetSystemMetrics(32); // 32 = SM_CXSIZEFRAME return User32.INSTANCE.GetSystemMetrics(5) + f; // 5 = SM_CXBORDER }
/** * In windows the user can customize the border and title bar size. * * @return titlebar height */ public static int getTitleHeight() { int f = User32.INSTANCE.GetSystemMetrics(33); // 33 = SM_CYSIZEFRAME return User32.INSTANCE.GetSystemMetrics(4) + f; // 4 = SM_CYCAPTION }