Handling WM_NCPAINT

This is a discussion on Handling WM_NCPAINT within the Windows Programming forums, part of the Platform Specific Boards category; How can I paint the border and caption of a window?? A small example would rock. I mean, I get ...

  1. #1
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293

    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
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    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
    Semi n00b Mithoric's Avatar
    Join Date
    Jun 2003
    Posts
    293
    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 09: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, 06:49 AM
  5. Error handling
    By mepaco in forum C++ Programming
    Replies: 12
    Last Post: 09-06-2002, 10:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21