My WinForms application has the standard Aero glass appearance on Vista/Windows 7.
I want to custom draw the window title bar so it retains the Aero glass appearance with the glass min/max/close buttons but without the title text and window icon. I have tried this by overriding WM_NCPAINT but overriding this event always causes the glass to be removed.
Does anyone know how to override WM_NCPAINT with glass in place in order to effectively draw over the glass area correctly?
I don't have a solution involving
WM_NCPAINT
, but I have a solution that does what you want it to do, and perhaps cleaner than theWM_NCPAINT
-version would be.First define this class. You'll use its types and functions to achieve your desired functionality:
Next, in your form, you simply do this:
Here's the result:
http://img708.imageshack.us/img708/1972/noiconnocaptionform.png
I normally make a base class that implements Form with all my funky extended behavior and then let my actual forms implement that base class, but if you only need it for one Form, just put it all in there.