Sorry, that was a typo, I compiled it with SetWindowLong in the other handler. The SetWindowLong line doesn't make a difference, nothing happens at all. (at least nothing directly visual) Even without the SetWindowLong call the borders of the NC area aren't painted at all. The border doesn't get painted, but that didn't happen in the first place, my problem was that not only the buttons were painted, but a small area around the buttons too, and there is a line drawn that seperates the client and the non-client area. If I don't make a handler to NCACTIVATE at all windows paints the NC area as soon as it looses focus, otherwise not. Maybe I didn't make myself entirely clear, but I would like windows to paint nothing at all outside of the client area, as windows refuses to draw the button without background. Heh, this isn't as easy as I thought it would be, even explaining a simple problem can be quite hard.