Click here to Skip to main content
16,016,168 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want the scroll bar, dialog boxes, buttons and message boxes of my application to have the same colour, but one different from the default ones. I have acquired knowledge on how to change tha colour of dialogue boxes and buttons, but I am yet to learn how to change that of the scrollbar and message boxes. Can anyone here show me how to change the colour of message boxes for my Win32 C++ application?

What I have tried:

I have Googled for many hours and searched several developer websites.
Posted
Updated 6-Nov-23 3:45am
v2

For a ScrollBar you respond to the WM_CTLCOLORSCROLLBAR message (Winuser.h) - Win32 apps | Microsoft Learn[^]. I am not sure about MessageBox, as that is a dynamically built dialog, which is managed internally by Windows. You may be able to do it with SetWindowTheme function (uxtheme.h) - Win32 apps | Microsoft Learn[^].
 
Share this answer
 
Comments
Gbenbam 30-Oct-23 13:09pm    
Thanks for the solutin.
I suppose you have to write your own. Or, possibly, you might find something here at CodeProject. This one XMessageBox - A reverse-engineered MessageBox()[^] is an oldie-GOLDIE, but there are alternatives.
 
Share this answer
 
Comments
Maxim Kartavenkov 25-Oct-23 11:58am    
5.
CPallini 25-Oct-23 16:32pm    
Thank you.
Gbenbam 30-Oct-23 13:09pm    
Thanks for the solution.
CPallini 31-Oct-23 2:54am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900