Change Win32 Menu Colors

Is there a way to change the colors used by regular Win32 menus (background, text and backlight) for a single process, without using SetSysColors?

(SetSysColors makes a global change, which is bad, and if you complete or forget to set the colors again with SetSysColors before exiting, they will not be restored until you exit the system.)

+3
source share
3 answers

If I believe your comment on Rob, this is for a skin app with a special look. So it’s probably true, since ferek tells (unfriendly ...) to use the owner-created menus: you can pinpoint their appearance.

+2
source

API SetMenuInfo() - . , .

- :

MENUINFO mi = { 0 }; 
mi.cbSize = sizeof(mi); 
mi.fMask = MIM_BACKGROUND|MIM_APPLYTOSUBMENUS; 
mi.hbrBack = hBrush; 

HMENU hMenu = ::GetMenu(hWnd); 
SetMenuInfo(hMenu, &mi); 
+9

I have to ask why? Accepting the usual look of Windows is good; this means that users can be sure that your user interface has consistent elements to which they can compare their experience using other platform software.

[Of course, I probably preach the convert, but I thought I could say that anyone who reads the answer for this does not start to make all their menus blue and pink because it looks pretty.]

+3
source

Source: https://habr.com/ru/post/1698438/


All Articles