Lodle
Lodle

Reputation: 32217

Change min/max/close buttons theme

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?

Upvotes: 3

Views: 2745

Answers (3)

Roel
Roel

Reputation: 19642

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 ;)

Upvotes: 0

Lodle
Lodle

Reputation: 32217

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

Upvotes: 0

Matthew Scharley
Matthew Scharley

Reputation: 132414

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.

Upvotes: 2

Related Questions