Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute WaitForSingleObject IsRunning(GeorgeTasker)
Message
From
19/03/2004 12:27:06
 
 
To
19/03/2004 12:00:48
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00887963
Message ID:
00887983
Views:
48
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
Map
View

Click here to load this message in the networking platform