views:

807

answers:

3

Hi, im currently overiding the WM_NCPAINT, WM_NCCALCSIZE and WM_NCACTIVATE to paint my own color/themed title bar for an application im working on. Now this is working great however the min, max and close buttons still are xp default theme.

I looked into what controls them and the mouse messages do. However they also contol resizing and other functions that I dont want to lose.

Is there an easy way to just change the theme of these buttons?

  • Windows XP
  • MFC Forms
  • Visual studio 2005
+1  A: 

I think your best bet here is to disable the buttons and redraw them with something akin to to the code I posted in this answer. It's in C# with WinForms, but the vast majority of it is overloaded WndProc() anyway, which you should be able to use almost copy/paste into MFC.

Implementing click handlers to do what you want them to do is trivial.

Note: The asker of that question said the code didn't work in Vista. I don't have a Vista box, but it works for me in XP.

Matthew Scharley
A: 

This also helped: http://www.catch22.net/tuts/titlebar

Lodle
That's actually the tutorial that I more or less translated to C#/WinForms to create the code I wrote and linked above.
Matthew Scharley
A: 

You can also check out how it's done in MFC Next (VS2008 SP1). The theming support there does custom draw of the whole title bar, you can get a few ideas from that. I presume they tested it on Vista, too ;)

Roel