Article ID: 121441
Article Last Modified on 11/17/2003
SET LIBRARY TO SYS(2004)+"foxtools"
@ 1,1 GET ext DEFAULT " " SAY "Enter the extension: "
READ
ext=ALLTRIM(ext)
IF LEN(ext)=0
RETURN
ENDIF
mpath=REPLICATE(CHR(0),256)
* Register and call the Windows API function.
mregister=regfn("GetPrivateProfileString","CCC@CIC","I")
mcall=callfn(mregister,"Extensions",ext,"",@mpath,256,"WIN.INI")
mpath=ALLTRIM(mpath)
CNT=OCCURS('\',mpath) && find the last backslash in the path
IF CNT=0
? CHR(7)
WAIT WINDOW "File Extension Not Found" && in the WIN.INI file
RETURN
ENDIF
x=AT('\',mpath,CNT) && find the position of the last backslash
mpath=SUBSTR(mpath,1,x-1) && extract just the path
@ 2,1 SAY "The path to the executable is " + mpath
Additional query words: VFoxWin FoxWin 2.50 2.50a 2.50b 2.50c
Keywords: kbcode KB121441