{First load it in the OnCreate event of a form):原文名称:Use TTF without Installing
procedure TForm1.FormCreate(Sender: TObject) ;
begin
AddFontResource('c:\FONTS\MyFont.TTF') ;
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ;
end;
{Before application terminates we must free it:}
procedure TForm1.FormClose
(Sender: TObject; var Action: TCloseAction) ;
begin
RemoveFontResource('C:\FONTS\MyFont.TTF') ;
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ;
end;
原文地址:http://delphi.about.com/cs/adptips2000/a/bltip1100_3.htm
没有评论:
发表评论