if ColorLabel > '
'
then
begin
SetItem := -1;
Parse := Split(ColorLabel, '
_');
Count := High(Parse);
R1 := 0;
G1 := 0;
B1 := 0;
for K := 0
to Count - 1
do
begin
// Get Color Name
ColorName := Split(Parse[K], '
,');
CLName := ColorName[Low(ColorName)];
SendMessage(HCombo, CB_ADDSTRING, 0, LParam(CLName));
// Get Color Value
Color := ColorName[High(ColorName)];
R := Byte(StrToInt('
$' + MidStr(Color, 3, 2)));
G := Byte(StrToInt('
$' + MidStr(Color, 5, 2)));
B := Byte(StrToInt('
$' + MidStr(Color, 7, 2)));
SendMessage(HCombo, CB_SETITEMDATA, K, LParam(
RGB(R, G, B)));
if (R = R1)
and (G = G1)
and (B = B1)
then
SetItem := K;
end;
if SetItem > -1
then
SendMessage(HCombo, CB_SETCURSEL, SetItem, 0);
end;