Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Love Foxpro
  Where is Love Foxpro?
 
 Vietnam
 Love Foxpro
 Tags
Subject: How to convert this code for Windows 7
Thread ID: 373613 Message ID: 373613 # Views: 79 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Win32API programming
Date: Sunday, March 24, 2013 5:49:35 AM         
   


llSucess = InstallSystemFont("C:\WINDOWS\fonts\fontname.TTF")

PROCEDURE InstallSystemFont()
LPARAMETERS lcFontLocFile
LOCAL lnNumFontsAdded

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

lnNumFontsAdded=AddFontResource(lcFontLocFile)
IF lnNumFontsAdded > 0
*\\Font added sucessfully, send notification to Windows so apps get updated
=SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0)
RETURN .T.
ELSE
*\\Unable to add font
RETURN .F.
ENDIF
ENDPROC

This code can run on WinXP but can not run on Windows 7

ENTIRE THREAD

How to convert this code for Windows 7 Posted by Love Foxpro @ 3/24/2013 5:49:35 AM
RE: How to convert this code for Windows 7 Posted by Rahul Moudgill @ 3/24/2013 8:46:06 AM