Is possible to detect XP theme names?
I think paint the background color of outlook class based on XP theme (blue, silver or green...).
Regards,
Maurilio
Is possible to detect XP theme names?
I think paint the background color of outlook class based on XP theme (blue, silver or green...).
Regards,
Maurilio
Maurilio,
The answer is supposedly here:
http://www.codeproject.com/csharp/xptheme.asp
It shows how to read this information from the registry. However, the key, ColorName, that it says holds the theme color, doesn't exist in my registry (and I am using themes). So, I don't know the anwser.
James
The API is GetCurrentThemeName() but I don't know how to use it as it requires wide chars strings.
EMG
Thanks, James and Enrico.
I´ll try any about it.
If I have success I´ll publish here.
Regards!
Maurilio
#define HKEY_CURRENT_USER 2147483649
function CurrentTheme()
local cTheme := "WindowsClassic"
local cKeyName := "Software\Microsoft\Windows\CurrentVersion\ThemeManager\"
oReg := TReg32():New( HKEY_CURRENT_USER, cKeyName )
if oReg:nError == 0
cTheme := StrTran( oReg:Get("ColorName", ""), chr(0),"")
do case
case cTheme == "NormalColor" ; cTheme := "XPBlue"
case cTheme == "HomeStead" ; cTheme := "XPGreen"
case cTheme == "Metallic" ; cTheme := "XPSilver"
otherwise ; cTheme := "WindowsClassic"
endcase
endif
oReg:Close()
return( cTheme )