Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fonts not Installing
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Fonts not Installing
Divers
Thread ID:
00275053
Message ID:
00275053
Vues:
50
Using some borrowed code, I tried the below and I always get the 'failure' wait window message. To test, I moved the .ttf files (all except tahoma) via the Explorer GUI to my desktop and then tried to run the program. Can anyone point out the mistake? This .prg is running on NT4/SP5 with VFP6/SP3. Thanks.
	copy file hatten.ttf to sys(2023)
	copy file tahoma.ttf to sys(2023)
	copy file tahomabd.ttf to sys(2023)
	copy file verdana.ttf to sys(2023)
	copy file verdanab.ttf to sys(2023)
	copy file verdanai.ttf to sys(2023)
	copy file verdanaz.ttf to sys(2023)
	
	DECLARE INTEGER AddFontResource IN GDI32.DLL ;
	STRING @ lpszFileName
	DECLARE INTEGER SendMessage IN USER32.DLL ;
	INTEGER hWnd, ;
	INTEGER Msg, ;
	INTEGER wParameter, ;
	INTEGER lParameter
	#DEFINE HWND_BROADCAST 0xFFFF
	#DEFINE WM_FONTCHANGE  0x001D 
	LOCAL nNumFontsAdded
	LOCAL oWSH, cFontPath
	oWSH=CREATEOBJ('Wscript.Shell')
	cFontPathDest = oWSH.SpecialFolders('FONTS')
	cFontPathSource = sys(2023)
	nNumFontsAdded=AddFontResource(cFontPathSource)
	IF nNumFontsAdded > 0
		*  We added fonts, so update the world
		=SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0)
		*  notifies WinApps about change font table
		wait window ' ' +alltrim(str(nNumFontsAdded))
	ELSE
		*  Unable to add font;  maybe not a supported format
		wait window 'no add fonts!'
	ENDIF
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform