Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shellexecute()
Message
From
25/03/2013 17:04:43
 
 
To
25/03/2013 16:52:32
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01569197
Message ID:
01569199
Views:
92
>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".
Previous
Reply
Map
View

Click here to load this message in the networking platform