Я думаю, что это работает:
interface
TFontDialog = class(Dialogs.TFontDialog)
const
IDCOLORCMB = $473;
protected
procedure WndProc(var Message: TMessage); override;
procedure DoShow; override;
end;
...
implementation
procedure TForm1.FormCreate(Sender: TObject);
begin
FontDialog1.Execute();
end;
{ TFontDialog }
procedure TFontDialog.DoShow;
const
SMyColorName: PChar = 'Custom...';
CMyColor: TColor = $0033ccff;
begin
SendDlgItemMessage(Handle, IDCOLORCMB, CB_INSERTSTRING, 0, Integer(SMyColorName));
SendDlgItemMessage(Handle, IDCOLORCMB, CB_SETITEMDATA, 0, ColorToRGB(CMyColor));
end;
procedure TFontDialog.WndProc(var Message: TMessage);
begin
inherited;
with Message do
if (Msg = WM_COMMAND) and (WParamHi = CBN_SELENDOK) and (WParamLo = IDCOLORCMB) and (SendDlgItemMessage(Handle, IDCOLORCMB, CB_GETCURSEL, 0, 0) = 0) then
with TColorDialog.Create(Self) do
try
Color := TColor(SendDlgItemMessage(Self.Handle, IDCOLORCMB, CB_GETITEMDATA, 0, 0));
Options := [cdFullOpen];
if Execute(Self.Handle) then
SendDlgItemMessage(Self.Handle, IDCOLORCMB, CB_SETITEMDATA, 0, ColorToRGB(Color));
finally
Free;
end;
end;
Но обратите внимание, как правильно утверждает Дэвид в комментариях ниже, что этот код может завершиться ошибкой, если диалоговое окно должно измениться (достаточно значительно) в будущей версии Windows,Это может или не может быть showtopper для OP.