Overriding Nonclient window area
Posted on 2001-08-17
(Working in VC++ 6.0 in Win98 using Win32 *NOT* MFC)
I'm trying to make a window that overrides all of the default nonclient window painting--I don't want windows to ever paint any part of my window using any default functions. I want to retain the functions of the close box, the maximize box, minimize, and system menu, but I want to, for example, draw my caption bar, my window borders, my close box, min/max boxes, etc.
I tried overriding WM_NCPAINT and several other NC messages, but for some reason various window parts are painted anyways, but only at specific times. Such as, the close box and min/max boxes along with their little borders that are part of the caption bar, are painted when I position my mouse over the sizable borders of the window. Another thing is that whenever, due to programmatic error, my program goes into an infinite loop and disallows my WM_NCPAINT function to be performed, Windows paints my caption bar when the window goes inactive.
I would appreciate source code that will work, because I have been pulling my hair out playing around with various attempts to accomplish this. MSDN isn't much help because Microsoft is under the impression that you don't need to override the drawing of these things because that would make the user interface of Windows nonstandard, and therefore make it not user-friendly--I don't care.