Outlook2003Bar "themes"

Topics: General
Developer
Nov 8, 2006 at 4:49 PM
Hi experts!
I need some help...

I'm trying to make Outlook2003Bar behave like Outlook 2003 about Windows colors (now I'm using predefined themes based on the three default Windows XP themes).

I need to know if Outlook 2003 (and Office's 2003 applications) uses Windows colors, theme elements or a predefined "schema" to render the colors to implement in Outlook2003Bar.

I've checked GetSysColor function in MSDN Library, but some colors doesn't exist.
I've checked GDIPlusX Theme Explorer but I don't know which object Outlook 2003 bar inherits (maybe a mixture of objects?)
I've read something on the web and seems like Office uses predefined schemas (CSS files) to render the control's colors, but I'm not sure.

Someone could help me in this task?
Developer
Nov 14, 2006 at 10:00 PM
Not sure how it does it - but I did hear that in Outlook 2007, the Office team doesn't respect Windows theme colors persay - they created their own and then react to the Windows themes accordingly.
Jan 5, 2007 at 8:40 PM
Pretty sure Outlook and other tools use system colors for various color schemes. Once a Theme is set the colors in that theme are reflected in the system colors. So if you use Luna you get the blue background and light background color that very light blue.

FWIW, this is pretty much moot with Vista, since Vista doesn't really 'do' Themes. Every themes aware app I've used uses the same generic grey background that you see on a Win2000 machine (or XP without Themes).

I think ideally you'd just want to let people choose from one of a few themes...

+++ Rick ---
Developer
May 9, 2007 at 7:11 PM
Edited May 9, 2007 at 7:47 PM
Here's my best effort (AddThemeColor just stores the color value and name in a collection.):
* Necessary API calls:
*---------------------------
DECLARE LONG OpenThemeData IN UXTHEME ;
  LONG HWND, ;
  STRING classList
 
DECLARE LONG GetThemeColor IN UXTHEME ;
  LONG hTheme, ;
  LONG iPartId, ;
  LONG iStateId, ;
  LONG iPropId, ;
  LONG @pColor
 
DECLARE LONG CloseThemeData IN UXTHEME LONG hTheme
 
* THIS.GetThemeColor()
*------------------------------------------------------------------------------
LPARAMETERS cClass AS STRING, nPartId, nStateId, nPropId AS INTEGER
 
nTheme = OpenThemeData(0, STRCONV(m.cClass + 0h00, 5))
 
IF nTheme > 0
 
  nColor = 0
 
  nReturn = GetThemeColor(m.nTheme, m.nPartId, m.nStateId, m.nPropID, @m.nColor)
 
  IF m.nReturn <> 0 && The color doesn't exist.
  
    nColor = 0
 
  ENDIF
 
  CloseThemeData(m.nTheme)
 
ENDIF
 
RETURN m.nColor
 
* LoadThemeColors()
*---------------------------------------------------------------------
IF FILE(GETENV("windir")+"\system32\uxtheme.dll")
 
  * Title, dark
  THIS.AddThemeColor(THIS.GetThemeColor("ExplorerBar", 5, 0, 3803), "TitleDark") && too bold in olive
 
  *Title, light
  THIS.AddThemeColor(THIS.GetThemeColor("ExplorerBar", 1, 0, 3821), "TitleLight")
  
  * Not Focused, Not Selected dark
  THIS.AddThemeColor(THIS.GetThemeColor("ExplorerBar", 2, 0, 3821), "NormalDark")
 
  * Not Focused, Not Selected - Light
  THIS.AddThemeColor(THIS.GetThemeColor("ExplorerBar", 5, 0, 3802  ), "NormalLight")
 
  * Focused, Not Selected - Light
  THIS.AddThemeColor(THIS.GetThemeColor("ExplorerBar", 3, 0, 3821 ), "FocusedLight")
 
ELSE
 
  * Title, dark
  THIS.AddThemeColor(RGB(10,57,138), "TitleDark")
 
  *Title, light
  THIS.AddThemeColor(RGB(81,128,208), "TitleLight")
 
  * Not Focused, Not Selected dark
  THIS.AddThemeColor(RGB(128,167,225), "NormalDark")
 
  * Not Focused, Not Selected - Light
  THIS.AddThemeColor(RGB(197,221,250), "NormalLight")
 
  * Focused, Not Selected - Light
  THIS.AddThemeColor(RGB(241,254,255), "FocusedLight")
 
ENDIF
 
* Focused, Not Selected - Dark
THIS.AddThemeColor(RGB(226,193,142), "MediumOrange")
 
* Selected Dark
THIS.AddThemeColor(RGB(240,160,38), "DarkOrange")
 
* Selected Light
THIS.AddThemeColor(RGB(248,216,126), "LightOrange")
 
RAISEEVENT(THIS, "Render", THIS.oThemeColors)
 
 
Developer
Jun 22, 2007 at 6:39 PM
Hi Alan!
Tks for you suggestion.

I think that this approach to get the OS active theme will be no longer used after the behavior changes made in the new versions of Windows (Vista) and Office (2007) - like Rick said.
Thinking on it, I've made a lot of changes in Outlook2003Bar (this name will be changed soon).
Take a look at the new version at http://weblogs.foxite.com/emersonreed/archive/2007/05/07/OutlookNavBar_control_preview.aspx and send me some feedback.

Again, tks for your help!