Mega Code Archive

 
Categories / Delphi / System
 

Get systen menu fonts

Title: 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;