Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetSysColor
Message
From
10/11/2006 16:25:07
 
 
To
10/11/2006 08:36:16
Luis Navas
Independent Consultant
Auckland, New Zealand
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01167615
Message ID:
01168875
Views:
19
>Hi Emerson, can you take a look at Carlos Alloati Progressbar, it detects any windows color that Windows uses. Maybe you can find something in his code, or aks him
>
>Take care.
>
>Luis
>

Luis:

I don´t do anything special, it's just the common controls API doing all the work.

Emerson:

I am also interested in what you want. I think you should take a look at the uxtheme API for what you want.

Open C:\WINDOWS\Resources\Themes\Luna\luna.msstyles with PE explorer (this is just a DLL file with a .msstyles extension) and you will see a TEXTFILE section with text resources like:

NORMALBLUE_INI
NORMALHOMESTEAD_INI
NORMALMETALLIC_INI

Inside this text resources you can see things like:
;--------- Globals -------------------------
[globals]

; global edge colors (redefined in various parts) 
EdgeLightColor      = 241 239 226
EdgeHighLightColor  = 255 255 255
EdgeShadowColor     = 172 168 153
EdgeDkShadowColor   = 113 111 100 
EdgeFillColor       = 236 233 216

;--------- system metrics -------------------------------
[SysMetrics]
;The system metric colors also effect non-themed controls.

ScrollbarWidth = 21
ScrollbarHeight = 21

Window = 255 255 255
MenuBar = 236 233 216
Menu = 255 255 255
Background = 0 78 152
Btnface = 236 233 216
Highlight = 49 106 197

ActiveCaption = 0 84 227
CaptionText = 255 255 255
InactiveCaption = 122 150 223
InactiveCaptionText = 216 228 248
GradientActiveCaption = 61 149 255
GradientInactiveCaption = 157 185 235
HighlightText = 255 255 255
MenuHilight = 49 106 197
BtnShadow = 172 168 153
GrayText = 172 168 153
BtnHighlight = 255 255 255
DkShadow3d = 113 111 100
Light3d = 241 239 226
This seem to be rgb colors.

Open up also C:\WINDOWS\Resources\Themes\Luna\Shell\NormalColor\shellstyle.dll with e PE explorer, you will find inside a UIFILE resource that has things like color values for elements and gradients too.

My understanding is that all these values can be queried using the uxtheme API, which to put it mildly, is poorly documented, with very few examples.

Also there are some colors that you cannot query, since the controls are drawn using bmps stored inside the same shellstyle.dll (check the BITMAP section)

Your main problem here is that you are trying to emulate something that is really a mess in itself:

http://blogs.msdn.com/jensenh/archive/2006/08/10/694577.aspx

And the other problem is that the Office colors are really hardwired to the XP themes, for example:

http://www.vbrad.com/article.aspx?id=102


Carlos
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform