Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shellexecute()
Message
De
25/03/2013 17:04:43
 
 
À
25/03/2013 16:52:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01569197
Message ID:
01569199
Vues:
93
>We have a VFP executable which needs to call an exe written in VB. It's been coded as
>SHELLEXECUTE(0,"OPEN",lcExe,lcParms,'',1)
>The VFP programs continues immediately after making this call.
>Is there some parameter which would suspend the VFP program until the program called by SHELLEXECUTE() completes?
>Thanks.............Rich



There's another way to prepare the structure for ShellExecute() which is more complex in VFP, but it will give you what you want. Here's the code in C++:
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "c:\\MyProgram.exe";		
ShExecInfo.lpParameters = "";	
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;	
ShellExecuteEx(&ShExecInfo);
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
There's a version that does a similar function in VFP. It's not pretty. You may be able to use it as a black box dropped into your app. Good luck. :-)
http://social.msdn.microsoft.com/Forums/en-US/visualfoxprogeneral/thread/9f663558-56ab-4bda-9d4c-2f966979356c/

Look for "FUNCTION LaunchExeAndWait".
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform