JdeB,
This works but The Font Thing shows a warning symbol next to font and is not able to uninstall the font, so I think it is not being installed correctly. But it works, thanks. Font was in same folder as script.
#include <GuiConstants.au3>
#include<file.au3>
FileChangeDir (@ScriptDir)
$rc = InstallFont("ariblk.ttf","Arial Black")
ConsoleWrite('@@ Debug(2) : $rc = ' & $rc & @lf & '>Error code: ' & @error & @lf);### Debug Console
MsgBox(0, "Font Installed", "Arial Black ")
;
Func InstallFont($SourceFile,$FontDescription)
Local $HWND_BROADCAST = 0xFFFF
Local $WM_FONTCHANGE = 0x1D
Local $null, $FontFile, $FontExt
_PathSplit($SourceFile,$null,$null,$FontFile,$FontExt)
$FontFile = $FontFile & $FontExt
Local $rc = FileCopy($SourceFile,@WindowsDir & "\fonts\" & $FontFile,1)
If $rc = 0 Then
SetError(1)
Return 0
EndIf
Local $res = DllCall("gdi32.dll","Int","AddFontResource","str",@WindowsDir & "\fonts\" & $FontFile)
If $res[0] > 0 Then
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts", $FontDescription, "REG_SZ", $FontFile)
DllCall("user32.dll","Int","SendMessage","HWND",$HWND_BROADCAST,"int", $WM_FONTCHANGE,"int", 0,"int", 0)
Return 1
Else
SetError(2)
Return 0
EndIf
EndFunc