Some Color issues...redirecting the registry? =)
-
Howdy Folks! Is there a way to redirect my dialog to get its own system colors somewhere else in the registry? I know how to write the colors into the registry, but I want to know if there is a way to make my application only to look for the registry colors elsewhere. I would also like to know how to change the color of the Menu in my MFC application, I have tried to add code to my OnDrawItem when its called by the Menu, but I don't know if I use the right commands (I'm no ACE at C++ so far, hehe, learning fast though) Another "thingie", hmm... I have set my dialogs background with the SetDialogBkColor() but it seems like the (what do you call it, hmm... border, frame, nm) the outer edge of the window is still taking the colors from the system. How do I paint that area? Then there's the problem with my controls. I have a Slider that still takes the system color in it's "slider-path" and on the "slider-knob" (or whatever you call these, hehe). Where can I set those colors? Then theres my ComboBox wich has that little arrow, (you know, the one you klick on to bring down the ComboBox's menu) I want to set its color too =) If you happen to know how I can "redirect-the-registry-thingie" there's no hurry for the rest of the answers, but I'd like to know the other ways to do it too =) Thats all Folks, thanks for redin'! /Fredrik
-
Howdy Folks! Is there a way to redirect my dialog to get its own system colors somewhere else in the registry? I know how to write the colors into the registry, but I want to know if there is a way to make my application only to look for the registry colors elsewhere. I would also like to know how to change the color of the Menu in my MFC application, I have tried to add code to my OnDrawItem when its called by the Menu, but I don't know if I use the right commands (I'm no ACE at C++ so far, hehe, learning fast though) Another "thingie", hmm... I have set my dialogs background with the SetDialogBkColor() but it seems like the (what do you call it, hmm... border, frame, nm) the outer edge of the window is still taking the colors from the system. How do I paint that area? Then there's the problem with my controls. I have a Slider that still takes the system color in it's "slider-path" and on the "slider-knob" (or whatever you call these, hehe). Where can I set those colors? Then theres my ComboBox wich has that little arrow, (you know, the one you klick on to bring down the ComboBox's menu) I want to set its color too =) If you happen to know how I can "redirect-the-registry-thingie" there's no hurry for the rest of the answers, but I'd like to know the other ways to do it too =) Thats all Folks, thanks for redin'! /Fredrik
Before you go messing around with color in your dialog box, you should go to this web page: http://www.iarchitect.com/mshame.htm It talks about all of the evils of user-interface design. Sure, you can setup your own registry keys for colors, but at that point, they are no longer considered "system" colors. In order to paint the 3-d portions of your dialogs, you'll probably have to override the OnPaint() function and do *all* the drawing yourself. As far as painting controls, the same thing applies, only you'll have to subclass the controls and override their OnPaint code too. Don't forget to make them owner-drawn in your dialogs too. Are you sure all of this is worth the effort? If you want to make your dialogs look more vibrant with less work, use Visual Basic...
-
Before you go messing around with color in your dialog box, you should go to this web page: http://www.iarchitect.com/mshame.htm It talks about all of the evils of user-interface design. Sure, you can setup your own registry keys for colors, but at that point, they are no longer considered "system" colors. In order to paint the 3-d portions of your dialogs, you'll probably have to override the OnPaint() function and do *all* the drawing yourself. As far as painting controls, the same thing applies, only you'll have to subclass the controls and override their OnPaint code too. Don't forget to make them owner-drawn in your dialogs too. Are you sure all of this is worth the effort? If you want to make your dialogs look more vibrant with less work, use Visual Basic...
Hi again! Thanks for the info John, and the site you gave me was good. I do need to change the colors though, even though it's sort of against my will, hehe. How do I direct the registry so that I can make my application get its own colors (true that they wouldn't be "system" colors no more, like you said, good point). I want the colors of the other applications running to still use the real system colors, and only my application to use the "fake" or call them "virtual" system colors. =) I would guess that this way would be the best since it would give me a better view of the colors than to override OnPaint code for all the controls. Thanks again, /Fredrik
-
Hi again! Thanks for the info John, and the site you gave me was good. I do need to change the colors though, even though it's sort of against my will, hehe. How do I direct the registry so that I can make my application get its own colors (true that they wouldn't be "system" colors no more, like you said, good point). I want the colors of the other applications running to still use the real system colors, and only my application to use the "fake" or call them "virtual" system colors. =) I would guess that this way would be the best since it would give me a better view of the colors than to override OnPaint code for all the controls. Thanks again, /Fredrik
I'd probably setup registry keys (as strings) that contained the three color values used to instantiate a CCOLORREF value. DlgBkgrnd="0,0,0" DlgButtonFace="1,1,1" etc... I would also probably set these up under the HKEY_CURRENT_USER key if you anticipate more than one user using the software on a given machine. This way, each user's settings will be unique to that user (when they log on to the machine). I believe there's a couple of registry classes here on Code Project.
-
I'd probably setup registry keys (as strings) that contained the three color values used to instantiate a CCOLORREF value. DlgBkgrnd="0,0,0" DlgButtonFace="1,1,1" etc... I would also probably set these up under the HKEY_CURRENT_USER key if you anticipate more than one user using the software on a given machine. This way, each user's settings will be unique to that user (when they log on to the machine). I believe there's a couple of registry classes here on Code Project.
Hi! I know how to do what you just described, but what I need to know is how to override the system colors for my dialog window only. I have no clue how to make my application to actually look for the colors elsewhere than at the place where windows has it's system colors. I know how to create the keys and set upp the palette values I need in my dialog, but when I have made my own palette in the registry, I have no clue how to make the dialog to actually be pointed to my own defined palette in the registry rather than the one it is pointing at by default (the system colors). Thanks a bunch, /Fredrik