Re: Theme colors in the Vista era



Office 2003 didn't ignore the theme. When using the blue Luna theme Ofiice
showed up very blue, when Olive then olivish, when silver then silver
grey, and when classic then plain grey.

I use the following code. But frankly I don't know if the "if
fWinVistaUpwards..." bit will be sufficient...

if IsThemed then
begin
Result := tsOffice2003Classic;

hinstDll := LoadLibrary('uxtheme.dll');
if hinstDll <> 0 then
begin
try
GetCurrentThemeName := GetProcAddress(hinstDll,
'GetCurrentThemeName');

if Assigned(GetCurrentThemeName) then
begin
SetLength(FileName, 255);
SetLength(ColorScheme, 255);
SetLength(SizeName, 255);
GetCurrentThemeName(PWideChar(FileName), 255,
PWideChar(ColorScheme), 255, PWideChar(SizeName), 255);

if fWinVistaUpwards then
begin
Result := tsOffice2007Luna;
if (PWideChar(ColorScheme) = 'NormalColor') then
begin
Result := tsOffice2007Obsidian;
end;
end

else
begin
Result := tsOffice2003Classic;
if (PWideChar(ColorScheme) = 'NormalColor') then
begin
Result := tsOffice2003Blue;
end
else
if (PWideChar(ColorScheme) = 'HomeStead') then
begin
Result := tsOffice2003Olive;
end
else
if (PWideChar(ColorScheme) = 'Metallic') then
begin
Result := tsOffice2003Silver;
end;
end;
end;

finally
FreeLibrary(hinstDll);
end;
end;
end

else
begin
Result := tsWindowsXP;
end;
end;


.