OnNcPaint not called when dialog gains focus

G

Guest

I have an MFC dialog-based application. I have overridden the OnNcPaint
method and draw some images in the non-client area of the dialog. It works
just fine when, for example, some other window is in front of my dialog and
that window is moved off of my dialog. But when my dialog actually gains
focus, as when I click on its entry in the taskbar or click directly on my
dialog, my OnNcPaint does not get called and instead it draws the default,
standard images in the non-client area (i.e. the border, the title bar,
etc.). How do I get it to call my overridden OnNcPaint when the dialog gains
focus, so that I can assure that my painting occurs instaed of the default
painting?

- Roger Garrett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top