//聲明:
DrawCaption(
p1: HWND; {窗口句柄}
p2: HDC; {設備環境句柄}
const p3: TRect; {矩形}
p4: UINT {選項}
): BOOL;
//p4 參數可選值:
DC_ACTIVE = 1; {使用活動標題欄顏色}
DC_SMALLCAP = 2; {使用當前小標題欄字體}
DC_ICON = 4; {使用圖標}
DC_TEXT = 8; {繪制標題}
DC_INBUTTON = $10; {按下狀態}
DC_GRADIENT = $20; {使用漸變色}
DC_BUTTONS = $1000; {}
//舉例:
procedure TForm1.FormPaint(Sender: TObject);
begin
DrawCaption(
Handle,
Canvas.Handle,
Rect(16,40,288,60),
DC_ACTIVE or DC_ICON or DC_TEXT or DC_GRADIENT
);
end;
//效果圖: