Thread: Handling WM_NCPAINT

  1. #1

    Handling WM_NCPAINT

    How can I paint the border and caption of a window?? A small example would rock. I mean, I get the DC and I try to paint but it doesn't work like the WM_PAINT ...

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    If you are using GetDCEx as described in msdn's WM_NCCREATE page then that may be the problem. Apparently, there is an undocumented flag for GetDCEx which is discussed on this page ("Undocumented flags for GetDCEx").
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Well I've tried but it just overwrites what I've done on the DC! If I move it off screen and on quickly it goes all garbled!

    How can I stop it reseting my changes?

  4. #4
    Bingo!

    How I did it --

    Windows paints over it right? So let it! As soon as it hits WM_NCPAINT send it through DefWindowProc..

    ie -- DefWindowProc( hwnd, msg, wParam, lParam );

    After that you are free to just do whatever you want.

    [edit:] Oh, and use GetWindowDC().
    Last edited by Mithoric; 03-11-2004 at 10:51 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. signal handling and exception handling
    By lehe in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2009, 10:01 PM
  2. event handling is serialized in MS Visual Studio C++ 2005 ??
    By mynickmynick in forum Windows Programming
    Replies: 3
    Last Post: 08-07-2008, 04:47 AM
  3. need help on error handling.
    By broli86 in forum C Programming
    Replies: 9
    Last Post: 06-19-2008, 11:55 AM
  4. Signal Handling - Are they part of ANSI C?
    By Stanley S in forum C Programming
    Replies: 3
    Last Post: 12-21-2005, 07:49 AM
  5. Error handling
    By mepaco in forum C++ Programming
    Replies: 12
    Last Post: 09-06-2002, 10:45 AM