views:

62

answers:

1

I'm trying to find any reference for this function, but I haven't found anything.

All I have is an obscure KB from Microsoft referencing that a programmer made boo-boo when coding a part of the Windows Mobile 6 where he should call SHGetSysColor but instead he called GetSysColor that gives a complete different color, for the same spec.

From what I could gather the GetSysColor read a color value in the registry from HKEY_LOCAL_MACHINE\Software\Microsoft\Color\SHColor or HKEY_LOCAL_MACHINE\Software\Microsoft\Color\DefSHColor and returns the color according to the index.

In that registry I have the following value for a standard Win Mobile 6.5

"DefSHColor"=hex:\
  ff,00,00,00,00,00,00,00,dd,dd,dd,00,ff,ff,cc,00,ff,ff,ff,00,15,af,bc,00,15,\
  af,bc,00,c9,e7,e9,00,14,9c,a7,00,ff,ff,ff,00,14,9c,a7,00,14,9c,a7,00,14,9c,\
  a7,00,15,af,bc,00,14,9c,a7,00,ff,ff,ff,00,c9,e7,e9,00,37,c7,d3,00,37,c7,d3,\
  00,ff,ff,ff,00,00,b7,c9,00,14,9c,a7,00,ff,ff,ff,00,15,af,bc,00,84,84,c3,00,\
  15,af,bc,00,14,9c,a7,00,ff,ff,ff,00,ff,ff,ff,00,00,00,00,00,ff,ff,ff,00,00,\
  00,00,00,ff,ff,ff,00,2e,44,4f,00,00,14,3c,00,00,f0,ff,00,ff,ff,ff,00,c9,e7,\
  e9,00,14,9c,a7,00,ff,ff,ff,00,14,9c,a7,00

And I realized that each four bytes represents a different color (RR,GG,BB,AA -- The AA I'm assuming here, as every color there has the AA byte as 00 which would mean that it's a solid color).

What I can't get a fix on is what each index mean, as I have 41 different colors in there.

Googling for SHGetSysColor in gives me only 7 matches, two of them are the KB from Microsoft (one in English, the other in French) one is from a Russian site (which I don't read), yet another two are from the freepascal.org and one from Koders.com that is describing the commctl.def file.

I went to the commctl.h trying to see if I could find reference tom this function, and found absolutely nothing.

No search on MSDN, either fro Google, Bing, or the default MSDN search gave me any result.

So, does anyone know what indexes are we talking about here?

A: 

I was able to find the information about the SHColor registry entry thanks to a Russian site.

This information used to be on MSDN, but it's no longer available.

The colors are indicated as follow:

Color#  Description

   0    COLOR_ALERT
        Obsolete.

   1    COLOR_ACCENTTEXT
        Obsolete.

   2    COLOR_CALOFFHOURS
        Obsolete.

   3    COLOR_CALONHOURS
        Obsolete.

   4    COLOR_TODAYTEXT
        Today screen text color.

   5    COLOR_STARTICONBACKGROUND
        Base color for title bar and soft keys
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

   6    COLOR_TODAYSEPARATOR
        Today screen separator line color.

   7    COLOR_TODAYMENU
        Today screen menubar background color.

   8    COLOR_NAVBAR
        Color of title bar
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

   9    COLOR_NAVBARTEXT
        Color of title bar text on
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  10    COLOR_NAVBARHILITE
        Obsolete.

  11    COLOR_NOTIFTRAY
        Notification tray background color
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  12    COLOR_NOTIFTRAYHILITE
        Background of highlighted icon in the notification tray
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  13    COLOR_BUBBLECAPTION
        Left color of bubble caption background gradient on
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  14    COLOR_GRADIENTBUBBLECAPTION
        Right color of bubble caption background gradient
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  15    COLOR_INTGRADLEFT
        Left color of a gradient listview background, for the interlaced rows.

  16    COLOR_INTGRADRIGHT
        Right color of a gradient listview background, for the interlaced rows.

  17    COLOR_HIGHGRADLEFT
        Currently not used.

  18    COLOR_HIGHGRADRIGHT
        Currently not used.

  19    COLOR_PHONEDIALERTEXT
        Text color of the text in the Phone dialpad buttons.

  20    COLOR_TRAYGRADLEFT
        Base color for title bar and soft keys
        Obs.:Windows Mobile 6 Standard only.

  21    COLOR_TRAYGRADRIGHT
        Right color of tray
        Obs.:Windows Mobile 6 Standard only.

  22    COLOR_TRAYTEXT
        Tray text color
        Obs.:Windows Mobile 6 Standard only.

  23    COLOR_TRAYBKGND
        Tray background color, if not a gradient
        Obs.:Windows Mobile 6 Standard only.

  24    COLOR_DIALPADBKGND
        Currently not used.

  25    COLOR_CRITGRADLEFT
        Left color of a critical bubble caption gradient
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  26    COLOR_CRITGRADRIGHT
        Right color of a critical bubble caption gradient
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  27    COLOR_BUBBLETITLE
        Text color of a bubble caption
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  28    COLOR_CRITBUBBLETITLE
        Text color of a critical bubble caption
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  29    COLOR_ALERTTITLE
        Alert title text color. An alert is a full screen message box
        Obs.:Windows Mobile 6 Standard only.

  30    COLOR_ALERTWINDOW
        Background color of a listview in alert. Also used for volume alert slider bar
        Obs.:Windows Mobile 6 Standard only.

  31    COLOR_ALERTRULE
        Color of alert horizontal separator line. An alert is a full screen message box
        Obs.:Windows Mobile 6 Standard only.

  32    COLOR_HOMETEXT
        Home Screen text
        Obs.:Windows Mobile 6 Standard only.

  33    COLOR_HOMERULE
        Home Screen horizontal separator line
        Obs.:Windows Mobile 6 Standard only.

  34    COLOR_HOMEHIGHLIGHT
        Home Screen background color of highlighted text
        Obs.:Windows Mobile 6 Standard only.

  35    COLOR_HOMEHIGHLIGHTTEXT
        Home Screen highlighted text
        Obs.:Windows Mobile 6 Standard only.

  36    COLOR_GRADLEFT
        Left color of a gradient listview background, used to draw alternating lines together with COLOR_INTGRADLEFT and COLOR_INTGRADRIGHT.

  37    COLOR_GRADRIGHT
        Right color of a gradient listview background, used to draw alternating lines together with COLOR_INTGRADLEFT and COLOR_INTGRADRIGHT.

  38    COLOR_STARTMENU
        Start Menu background color when there is no background bitmap
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.

  39    COLOR_STARTMENUTEXT
        Start Menu text.

  40    COLOR_TAPANDHOLD
        Tap and Hold
        Obs.:Windows Mobile 6 Professional and Windows Mobile 6 Classic.
Paulo Santos