Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Gradient on title bars

14 views
Skip to first unread message

Michiel Ouwehand

unread,
Aug 12, 1996, 3:00:00 AM8/12/96
to

Hello everybody,

About those gradients in captions, it is possible, and I wouldn't advice
doing it in WM_PAINT..

The way to go to flicker-free custom-drawn captions is capturing WM_NCPAINT
and WM_NCACTIVATE...

On WM_NCPAINT you check if the supplied clipping region is valid, if it is,
you draw the new caption (with or without gradient, and preferably not the
small icons (buttons) on the caption) and substract that area you drawed
from the clipping region, pass this new clipping region (which encloses all
of the non-client area except the caption you just displayed) on to the
DefWindowProc and supply the new region as wParam..

When WM_NCPAINT is called without a clipping region, create a new one at
the size of the window, 'substract' the part you draw and pass this region
on to DefWindowProc..

On WM_NCACTIVATE you just redraw the caption..

BTW, this sounds easy, but I can tell you it's a lot of tweaking and
hacking.. Messing around with system metrics, etc. But when it does work,
it looks good.. But, unless you really really know what you are doing and
don't mind spending a lot of time on the subject, I wouldn't reccommend it
to anybody.. Doing stuff like this will make you go into the deepest
undocumented hart of Win95..

Really, Win95, for example, finds it neccesary to redraw caption buttons
at the weirdest times, without even sending a message to the window (so, no
way to capture it).. Get Spy++, the Win32 SDK and a whole lot of hacking
fun is ready for you!

btw, I tested this method and it works. check out Jazz JackRabbit 2 when it
is released...

-----------------------------------------------------------------------
Michiel Ouwehand mic...@epicgames.com


0 new messages