Mega Code Archive

 
Categories / Delphi / Graphic
 

How to get systen menu fonts

Title: How to get systen menu fonts function GetMenuFont: TFont; var ncm: TNonClientMetrics; begin ncm.cbSize := SizeOf(TNonClientMetrics); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, SizeOf(TNonClientMetrics), @ncm, 0); Result := TFont.Create; { lfCaptionFont - regular captions lfSmCaptionFont - small captions lfMenuFont - menus lfStatusFont - status bars lfMessageFont - message boxes } Result.Handle := CreateFontIndirect(ncm.lfCaptionFont); end; procedure TForm1.Button1Click(Sender: TObject); begin label1.Caption := GetMenuFont.Name; end;