Hi Carlos
Cetin Basoz showed me this solution from the solution.app in VFP. It retrieves the application associated with a file extention and also the version number of the application. Here it is to find application associated with .DOC files:
LOCAL cExtn,cAppKey,cAppName
LOCAL oReg,regfile
cAppKey = ""
cAppName = ""
oReg = NewObject("FileReg",HOME()+"FFC\registry.vcx")
* Get Application
nErrNum = oReg.GetAppPath('DOC',@cAppKey,@cAppName)
* Remove switches here (i.e., C:\EXCEL\EXCEL.EXE /e)
IF ATC(".EXE",m.cAppName) #0
m.cAppName= ALLTRIM(SUBSTR(m.cAppName,1,ATC(".EXE",m.cAppName)+3))
IF ASC(LEFT(cAppName,1))=34 &&check for long file name in quotes
m.cAppName = SUBSTR(m.cAppName,2)
ENDIF
ENDIF
? 'App:',LOWER(m.cAppName)
? 'Version:', RIGHT(m.cAppKey,1)
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.