Thema: Delphi Load external font

Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.716 Beiträge
 
Delphi 12 Athens
 
#2

AW: Load external font

  Alt 8. Jan 2023, 19:12
HWND_BROADCAST is never sent with SendMessage, but with PostMessage.
Because otherwise there can be such problems if any application does not respond properly.
Alternatively SendNotifyMessage or SendMessageTimeout.

Why broadcast to ALL running applications in the system if you only temporarily install the font in your application?
SendMessage to Application.Handle



Zitat:
Delphi-Quellcode:
function LoadResourceFont(const AFileName: string): Boolean;
begin
  Result := AddFontResourceW(PWideChar(AFileName)) <> 0;
Delphi-Quellcode:
function LoadResourceFont(const AFileName: WideString): Boolean; // or UnicodeString
begin
  Result := AddFontResourceW(PWideChar(AFileName)) <> 0;
or
Delphi-Quellcode:
function LoadResourceFont(const AFileName: string): Boolean;
begin
  Result := AddFontResource(PChar(AFileName)) <> 0;
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests

Geändert von himitsu ( 8. Jan 2023 um 19:17 Uhr)
  Mit Zitat antworten Zitat