0

I am trying to make custom buttons in the title of the window. I am trying to make my own buttons such as close, maximize and minimize buttons. I used WM_NCPAINT to prevent the window from drawing its own buttons, and I am able to draw on the non-client area using WM_NCPAINT, but can I use the CreateWindow() function to create buttons in the non-client area? Or must I just draw that buttons using WM_NCPAINT without using CreateWindow()?

  • The non client area of a window is named as such exactly because it cannot hold children. You have to draw there manually with WM_NCPAINT. – Michael Chourdakis Jan 24 '22 at 05:20
  • 7
    Sometimes the easiest way is to make your window not actually have a non-client area, and draw your own fake non-client elements. – Mark Ransom Jan 24 '22 at 05:36
  • Have you seen [Drawing in the extended frame gives strange colors](https://stackoverflow.com/questions/31093494/drawing-in-the-extended-frame-gives-strange-colors)? – YangXiaoPo-MSFT Jan 25 '22 at 01:52

0 Answers0