0

I need to draw custom title bar, using Win10, VS2017, MFC, SDK10.0.16299.0.

When MyDialog::OnNcPaint() does not call CDialogEx::OnNcPaint(), the dialog frame is drawn incorrectly - the top corners are rounded while bottom corners are sharp, and dialog size increases in couple of pixels.

I need to keep the dialog in original size and shape. Any suggestions please ?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • Any reason you can't just draw your custom frame over the top of the one drawn by `CDialogEx::OnNcPaint()`? – Mark Ransom Oct 03 '22 at 16:19
  • I can only paint to NC area when base class is not called. When I call CDialogEx::OnNcPaint() inside of MyDialogEx::OnNcPaint() (even at first line), then my custom draw is not painted at all. – Robert Zak Oct 04 '22 at 10:22
  • 1
    Using `WM_NCPAINT` is deprecated as it doesn't work well together with DWM (desktop window manager). Use [DWM functions](https://learn.microsoft.com/en-us/windows/win32/dwm/customframe) instead to draw custom title bar on recent Windows versions. – zett42 Oct 05 '22 at 21:28

0 Answers0