Delphi-Quellcode:
function LoadResourceFont(const AFileName: string): Boolean;
begin
Result := AddFontResourceW(PWideChar(AFileName)) <> 0;
if Result then
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
;
end;
And a bit longer function for loading from resource.
I see that SendMessage freezes program. Without it not only not freezes app, but also font is loaded properly to controls
Initially I created functions in D7 and used it on XP-7.
Last I used it on D10.2 on 7, now after years in D11.2 also on 7, but now I see it not working as expacted (also in D7/XE2 test app).
What to do?