>lcAppPath = GtAppPath("DOC") >IF EMPTY(lcAppPath) > *-- no app associated >ELSE > *-- there's an associated app > *-- check if the file exists > IF FILE(lcAppPath) > *-- app exists > ELSE > *-- app not found > ENDIF > >ENDIF > >************************************************ >FUNCTION GtAppPath >************************************************ >LPARAMETER tcExtension > >#INCLUDE "ffc\registry.h" > >LOCAL loReg, lcAppKey, lcAppPath, lnErrNum > >SET CLASSLIB TO (HOME() + "ffc\registry") ADDITIVE > >loReg = CREATEOBJECT('FileReg') >lcAppKey = "" >lcAppPath = "" >lnErrNum = loReg.GetAppPath(tcExtension, @lcAppKey, @lcAppPath) > >RELEASE loReg >RELEASE CLASSLIB (HOME() + "ffc\registry") > >IF lnErrNum <> 0 > RETURN "" >ELSE > *-- return path only (e.g. remove stuff like %1, /e, etc.) > RETURN SUBSTR(lcAppPath, 1, ATC(".EXE", lcAppPath) + 4) >ENDIF > >>