Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Feb : GetThemeColor Question

www.cryer.info
Managed Newsgroup Archive

GetThemeColor Question

Subject:GetThemeColor Question
Posted by:"James A. Schulz" (jaschu..@wiseware.com)
Date:Sun, 26 Feb 2006 12:00:27 +0100

I, too, am trying to get the current text color of the system tray clock.  This is what I
have:

procedure TForm1.Button2Click(Sender: TObject);
var
   cr: TColorRef;
   colorStr: String;
   h: HRESULT;
begin
   h := GetThemeColor(ThemeServices.Theme[teClock], CLP_TIME,
                      CLS_NORMAL, TMT_TEXTCOLOR, CR);
   ShowMessage(IntToStr(h));
   ColorToIdent(cr,colorStr);
   ShowMessage(colorStr);
end;

the value returned for h is: -2147024890 (which does not correspond to any of the
constants listed in the docs for HRESULT).

the value returned for cr is always clBlack (i.e. 0) even though, for instance, in the
standard WindowsXP theme (Blue), the clock shows in white.

What am I doing wrong?

JAS

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive