this slowpoke moves

Install / Deinstall Font

 function RegisterFont(Datei: String): String;
 { erstellt zuerst eine FOT-Datei und installiert diese dann }
 var FotName: String;
     bErg: Boolean;
     iErg: Integer;
     a, b: Array[0..128] of Char;
       begin
       Result:='';
       FotName:=ChangeFileExt(Datei, '.FOT');
       StrPCopy(A,FotName);  StrPCopy(B, Datei);
        if not fileExists(Fotname) then
        bErg:=CreateScalableFontResource(0, a, b, '')
         else bErg:=true;
          if bErg then
           begin
           iErg:=AddFontResource(A);
           if iErg>0 then
            begin
            SendMessage(hwnd_broadcast, wm_fontchange, 0,0);
            Result:=FotName;
          end;
        end;
 end;

 function RemoveFont(Datei:String): boolean;
     begin
     result:=RemoveFontResource(PChar(Datei));
     SendMessage(hwnd_broadcast, wm_fontchange, 0, 0);
 end;
Install Font :
procedure TForm1.Button1Click(Sender: TObject);
begin
If OpenDialog1.Execute then
     RegisterFont(OpenDialog1.FileName);
end;
Deinstall Font :
procedure TForm1.Button2Click(Sender: TObject);
begin
 RemoveFont(OpenDialog1.FileName);
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate