uses
...Themes,UxTheme;
var
FTHEME_BUTTON: hTheme;
FTHEME_HEADER: hTheme;
FTHEME_COMBOBOX: hTheme;
procedure OpenTheme;
var
Version:TOSVERSIONINFO;
VersionNumber:Currency;
begin
FTHEME_BUTTON := 0;
FTHEME_HEADER := 0;
FTHEME_COMBOBOX := 0;
Version.dwOSVersionInfoSize := SizeOf(Version);
if GetVersionEx(Version) then
begin
VersionNumber := StrToCurrDef(Format('%d.%d',[Version.dwMajorVersion,Version.dwMinorVersion]),0);
if VersionNumber >= 5.1 then
if GetComCtlVersion >= ComCtlVersionIE6 then
begin
if IsThemeActive then
begin
FTHEME_BUTTON := OpenThemeData(Application.Handle,'BUTTON' );
FTHEME_HEADER := OpenThemeData(Application.Handle,'HEADER' );
FTHEME_COMBOBOX := OpenThemeData(Application.Handle,'COMBOBOX');
end;
end;
end;
end;
procedure CloseTheme;
begin
if FTHEME_BUTTON <> 0 then
CloseThemeData(FTHEME_BUTTON);
if FTHEME_HEADER <> 0 then
CloseThemeData(FTHEME_HEADER);
if FTHEME_COMBOBOX <> 0 then
CloseThemeData(FTHEME_COMBOBOX);
end;
|