General information
Category:
Windows API functions
Tracy, recapturing thread of CreateProcess... I'm insist with find application related with extension.
Try with this.
DEFINE CLASS RunFiles AS Custom
PROCEDURE RunFileNoEXE( sFilePath )
SET PROCEDURE TO "C:\.........\samples\classes\registry.prg"
oReg = CreateObject("FileReg")
*|-- File extension
m.cExtn = JUSTEXT( sFilePath )
nErrNum = oReg.GetAppPath(m.cExtn,@cAppKey,@cAppName)
IF m.nErrNum # ERROR_SUCCESS
MESSAGEBOX(C_EXTNOFOUND_LOC)
RETURN
ENDIF
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
*|-- Run REAL App, with file name parameter
llacordok = RunAndWait( m.cAppName, '61NC.XFDF', 'C:\FOXPRO\VFP8' )
IF !llacordok
=MESSAGEBOX("Unable to print Acord Form.",0+16+4096,"ERROR")
ELSE
WAIT WINDOW "Finished Printing" NOWAIT
ENDIF
ENDPROC
ENDDEFINE
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only