Hi Hilmar,
I just execute the code you suggested and I got an error "Invalid association or URL."
Can you tell me I what I did wrong in the following codes:
Myfile = "c:\toto.pdf"
Rundoc(Myfile)
and in the procedures storages:
*****************************************************************
FUNCTION RUNDOC(tcDocument)
LOCAL lnResult
DECLARE Integer ShellExecute ;
IN Shell32.dll ;
integer nWinHandle,;
String cOperation,;
String cFilename,;
String cPArameters,;
String cDirectory,;
Integer nShowWindow
** Retrieve the main VFP WIndow handle
** this handle is use by ShellExecute
DECLARE Integer FindWindow IN WIN32API String cNull,String cWinName
lnResult = ShellExecute(Findwindow(0,_Screen.Caption),"Open",tcDocument,"","c:\temp\",1)
**Error messages if the return value is < 32
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
***********************************************************
Thank for your help,
VSN
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement