Gadget background Color

BlitzMax Forums/MaxGUI Module/Gadget background Color

TAS(Posted 2008) [#1]
Can anyone tell me what is the default gadget (e.g. labels) background color (r,g,b)?


SebHoll(Posted 2008) [#2]
I assume you mean the default Windows control background colour.

This a platform specific solution that should work on most Windows OSs:

SuperStrict

Import MaxGUI.Win32MaxGUIEx

Extern "win32"
	Function GetSysColor%( pParam% )
EndExtern

?Win32
Local tmpColour% = GetSysColor( COLOR_BTNFACE )
Local tmpRed% = (tmpColour & $FF), tmpGreen% = ((tmpColour & $FF00) Shr 8), tmpBlue% = ((tmpColour & $FF0000) Shr 16)

Print "Red: " + tmpRed + " Green: " + tmpGreen + " Blue: " + tmpBlue
?
You need to use the GetSysColor() Windows API function (with the constant COLOR_BTNFACE which corresponds to the colour you want), and then convert the returned value into separate red, green and blue components.

Here is the MSDN link with a table of the other available colours you can retrieve:

http://msdn2.microsoft.com/en-us/library/ms724371(VS.85).aspx


TAS(Posted 2008) [#3]
Thanks,
I didn't realize the color was set through Windows and therefore could be different.


Blueapples(Posted 2008) [#4]
Right click your desktop, click properties, then appearance. You sure you haven't seen that before? Really?