Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change min/max/close buttons theme

Tags:

windows

mfc

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
like image 208
Lodle Avatar asked Aug 08 '26 05:08

Lodle


1 Answers

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.

like image 87
Matthew Scharley Avatar answered Aug 09 '26 18:08

Matthew Scharley