Gönderen Konu: Windows'a Font Yüklemek  (Okunma sayısı 997 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

CMNSOFT

  • Kıdemli Üye
  • *****
  • Rep: +2/-2
  • Çevrimdışı Çevrimdışı
  • Cinsiyet: Bay
  • İleti: 82
    • http://www.cmnsoft.com
Windows'a Font Yüklemek
« : 21 Ekim 2005 15:58:33 »

Kod: (delphi) [Seç]
Uses Registry;



Procedure InstallFonts(Source, FileName: String);

Var

   Reg: TRegistry;

   Bx: Bool;

   FontKey: String;

Begin

CopyFile(Source, ('C:\WINDOWS\FONTS\' + FileName), Bx);

FontKey:= 'Software\Microsoft\Windows\CurrentVersion\Fonts';

Reg:= TRegistry.Create;



With Reg Do

     Begin

     RootKey:= HKEY_LOCAL_MACHINE;

     LazyWrite:= False;

     OpenKey(FontKey, False);

     WriteString('TESTMICR(TrueType)', FileName);

     CloseKey;

     Free;

     End;



AddFontResource('C:\WINDOWS\FONTS\' + FileName);

SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

RemoveFontResource('C:\WINDOWS\FONTS\' + FileName);

SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);

End;










Kullanım Şekli

Kod: (delphi) [Seç]
Procedure TForm1.Button1Click(Sender: TObject);

Begin

InstallFonts('D:\Yedek\Fontlar\FP000100.TTF', 'FP000100.TTF');

End;
Kayıtlı
:::::::::::::::::::: www.CMNSOFT.com ::::::::::::::::::::