Hallo Leute,
ich möchte gerne die (undokumentierte) Funktion "InstallFontFile" aus der "%windir%\system32\fontext.dll" bzw. "%windir%\SysWOW64\fontext.dll" benutzen um einen
Font (ttf, otf, pfm) "elegant" in Win7x32x64 zu installieren. Dazu gibt es einen Artikel unter: http://stackoverflow.com/questions/7563…0-setup-project
In diesem ist auch ein Stück C# Code welcher das anscheinend ermöglicht. Im folgenden der relevante Auszug daraus:
[DllImport("fontext.dll", CharSet = CharSet.Auto)]private static extern void InstallFontFile(IntPtr hwnd, string filePath, int flags);string path = @"c:\Windows\Fonts\MyFont.pfm";InstallFontFile(IntPtr.Zero, path, 0);
Ich habe nun versucht das Ganze mal nach AutoIt zu konvertieren, bis dato aber ohne Erfolg:
[autoit]#RequireAdmin
InstallFontFile("c:\windows\fonts\synthetique_tt.ttf")
Func InstallFontFile($ff)
local $fedll = DllOpen("fontext.dll")
DllCall($fedll,"none","InstallFontFile","hwnd",0,"str",$ff,"int",0) ; @error gibt 0 zurück!!!!
DllClose($fedll)
EndFunc
PS: Im obigen Beispiel ist der Font vorher bereits in Fonts-Verzeichnis kopiert worden. "InstallFontFile" sollte eigentlich nur dem System dauerhaft den Font bekannt machen (Registry bzw. Sendmessage).
Meine Annahme ist nun, dass ich eventuell ein Problem mit den DLLCall-Parametern habe(obwohl @error == 0), hat jemand eine Idee?
Vielen DANK!