...get systen menu fonts?

Author: P. Below
Homepage: http://www.teamb.com

Category: System

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;

 

printed from
www.swissdelphicenter.ch
developers knowledge base