private void _InitializeWindowNonClientFrameThickness() { Size frameSize = new Size( NativeMethods.GetSystemMetrics(SM.CXSIZEFRAME), NativeMethods.GetSystemMetrics(SM.CYSIZEFRAME)); Size frameSizeInDips = DpiHelper.DeviceSizeToLogical(frameSize); int captionHeight = NativeMethods.GetSystemMetrics(SM.CYCAPTION); double captionHeightInDips = DpiHelper.DevicePixelsToLogical(new Point(0, captionHeight)).Y; WindowNonClientFrameThickness = new Thickness(frameSizeInDips.Width, frameSizeInDips.Height + captionHeightInDips, frameSizeInDips.Width, frameSizeInDips.Height); }
private void _InitializeCaptionHeight() { Point ptCaption = new Point(0, NativeMethods.GetSystemMetrics(SM.CYCAPTION)); WindowCaptionHeight = DpiHelper.DevicePixelsToLogical(ptCaption).Y; }