Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code which Runs associated Applications
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01425453
Message ID:
01425462
Vues:
63
You've to pass full file name including directory
lcFileName = FULLPATH("SlumDogMillionaire.avi")
RunApp(lcFileName)
>
>I am trying to develop some code to start applications according to the file associations of specific file extensions.
>
>ie start wmplayer.exe opening with a file SlumDogMillionaire.avi and playing it.
>
>The code that I was using which appeared to work was as follows, however at the code has stopped working
>but I'm not sure why
>
>if tcDocument = "SlumDogMillionaire.avi" it would run
>
>Can anyone tell me why this code doesn't work anymore? All parameters return the error "Invalid association or URL."
>
>
>
>FUNCTION RunApp(tcDocument)
>
>	LOCAL lnResult
>	DECLARE INTEGER ShellExecute ;
>		IN SHELL32.dll ;
>		INTEGER nWinHandle, ;
>		STRING cOperation, ;
>		STRING cFileName, ;
>		STRING cParameters, ;
>		STRING cDirectory, ;
>		INTEGER nShowWindow
>
>
>	DECLARE INTEGER FindWindow ;
>		IN WIN32API ;
>		STRING cNull, ;
>		STRING cWinName
>
>	lnResult = ShellExecute(FindWindow( 0, "Opening..."), "Open", tcDocument, "", gcFilmPath, 1)
>
>	IF lnResult < 32
>		DO CASE
>		CASE lnResult=2
>			Wait wind "Invalid association or URL."
>		CASE lnResult=31
>			Wait wind "No association."
>		CASE lnResult=29
>			Wait wind "Can't start application."
>		CASE lnResult=30
>			Wait wind "Application already open."
>		ENDCASE
>	ENDIF
>ENDFUNC
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform