We help IT Professionals succeed at work.

colour problem

markburns90
markburns90 asked
on
Medium Priority
213 Views
Last Modified: 2010-04-06
i have flatstyle's FlatColorComboBox and was wondering how can i change the the colors of the following thinks in windows in SEPARATE BUTTON CLICKS!

MENU

CAPTION TEXT

WINDOW

BACKGROUND

and if possible restore ALL back to normal!
Comment
Watch Question

Commented:
System Wide, or just in your app?

Gl
Mike

Author

Commented:
system wide!!!
SetSysColors
The SetSysColors function sets the colors for one or more display elements. Display elements are the various parts of a window and the display that appear on the system display screen.

BOOL WINAPI SetSysColors(
  int cElements,                 // number of elements to change
  CONST INT *lpaElements,        // address of array of elements
  CONST COLORREF *lpaRgbValues   // address of array of RGB values
);
 
Parameters
cElements
Specifies the number of display elements in the array pointed to by the lpaElements parameter.
lpaElements
Pointer to an array of integers that specify the display elements to be changed. For a list of display elements, see GetSysColor.
lpaRgbValues
Pointer to an array of unsigned long integers that contains the new red, green, blue (RGB) color value for each display element in the array pointed to by the lpaElements parameter.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, callGetLastError.

When you set the colors using SetSysColors()the color change won't be permanent. It will last until you reboot, then the previous colors will be set.

To make the change permanent, have a look at the [colors] section in the file win.ini. You can change the colors there and the change will be permanent.

Hope this helps,
Viktor
Commented:
i have ran into this problem before ... MAKING THE COLOR CHANGE PERMANENT ... and haven't found the perfect solution yet (i've changed the colors permanently but i have to log the user off ... not a good idea)

i don't think it's in the WIN.INI file since it's almost of no use in today's Win32 apps. Desktop settings are stored in HKEY_CURRENT_USER\Control Panel\ ...  do your modification there and other message-sending and when you've found the solution, just post it here so i can use it in my project (he he he ...)

Author

Commented:
any source code examples PLEASE?

Commented:
So what did you do? Did you log off the user or you did a much more clever one? (hehehe ...)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.