Customising a windows close buttons and title bar

  • Thread starter Thread starter thechaosengine
  • Start date Start date
T

thechaosengine

Hi all,

Some applications achieve a really nice look and feel in part because they
have changed the bar at the very top of the form window. There appears to
be a way to customise the whole bar and its buttons but I have no idea how
its done.

Can anyone point me in the right direction. Perhaps towards a tutorial or
something. I've looked myself but I'm not sure what to search for in google

Thanks

Simon
 
There are multiple ways of doing this.

Win32 - you could get the handle of the titlebar and then do whatever you
wished with it. That causes some pain with the teletubbies default XP look.
So I wouldn't recommend that.

The better way is to go change the window style to the 5th property (I
forgot the name), then it appears as just a canvas. You can then write
whatever you want to make it look like, and it won't interfere with the
teletubbies or barney look that XP might come up with in future.

- Sahil Malik
http://codebetter.com/blogs/sahil.malik/
 
SM> Win32 - you could get the handle of the titlebar and then do
SM> whatever you wished with it.

Pardon me, what is the "handle of the titlebar"?
 
tn> Some applications achieve a really nice look and feel in part
tn> because they have changed the bar at the very top of the form
tn> window. There appears to be a way to customise the whole bar and its
tn> buttons but I have no idea how its done.

Look at the WM_NCCALCSIZE, WM_NCPAINT, WM_NCHITTEST messages. By them you
tell Windows whether the particular point of your window is a title bar,
or close box, or system menu, etc, and draw whatever you wish on them. That's
WinAPI of course.

PS in most cases, the customized look appears to be worse than the standard
one, as Microsoft has skilled UI designers, after all :)
 
The titlebar is nothing but yet another window.

No, the titlebar is not a separate window. To draw in it you have to
handle the WM_NC* window messages.



Mattias
 
You might try looking in Petzold's book, Programming Windows With C#. It
has a good description of how to do the things you're talking about doing.

HTH

DalePres
MCAD, MCDBA, MCSE
 
Back
Top