🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6729

Re: TColor question.

#6729
From: Alan Bellingham
Date: Mon, 18 Apr 2005 15:17
28 lines
1838 bytes
"JBH" <jhanson@ae-solutions.com> wrote:

>I've noticed that colors like clWhite and clBlue resolve to 0xFFFFFF and 
>0xFF0000, respectively.  However, colors like clActiveBorder and 
>clBackground resolve to 0x8000000A and 0x80000001, respectively.  If I want 
>to extract the actual RGB information from these latter colors, where is the 
>RGB information stored?  Could someone give a brief explaination or a link 
>to the info, because I couldn't find it in the Builder help system.  Many 
>thanks,

Those are not RGB values. Instead, it's saying "Go get the system colour
for this instead."

You need to go check GetSysColor(). I strongly suspect that you'll find
that the clxxx values match the COLOR_xxx values with 0x80000000 added.

In other words:

  if (colour & 0x80000000)
  {
     colour = GetSysColor(colour & 0x7FFFFFFF);
  }

  // now extract RGB value as previously

Alan Bellingham
-- 
ACCU Conference 2005 - 20-23 April, Randolph Hotel, Oxford, UK
Technical Details
Message-ID: <7ej7615v6lc59n3etke45vmgqsnfplic3r@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4263c456@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,3f6aec92e5a1834d
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Alan Bellingham <alanb@episys.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: TColor question.
Date: Mon, 18 Apr 2005 16:17:53 +0100
Reply-To: alanb@episys.com
Message-ID: <7ej7615v6lc59n3etke45vmgqsnfplic3r@4ax.com>
References: <4263c456@newsgroups.borland.com>
X-Newsreader: Forte Agent 2.0/32.652
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 193.129.251.253
X-Trace: newsgroups.borland.com 1113837473 193.129.251.253 (18 Apr 2005 08:17:53 -0800)
Lines: 28
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail