Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShellExecute but wait for completion?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00354373
Message ID:
00354882
Vues:
18
>Ooh, risky :) May get slapped by the US Courts for that :)
>
>I've since discussed this with the client and they are going to specify minimum requirements that allow WSH to be used. Two problems now though:- On the task bar, a new item "Screen Blanker" appears. And, if you use Shell.Run and go back to VFP and press a few keys, there is no way of stopping these being executed once VFP has process. This screws the app as actions are processed and files then get deleted.
>

The only altrernatives open to you are a third party commerical add-in, or to use the ShellExecuteEx() API call to laucnh the document, and reutrns a real process handle - you could use API_APPRUN as a template for waiting on completion.

If all you need is to launch an executable and wait on completion, you can download and use API_APPRUN from here on UT, which gives just that kind of capability, but it requires an executable command line, not a document name.

>>Nigel,
>>
>>I get around this by requiring a minimum install of IE4.01 SP1 or later - updates all kinds of useful system DLLs as well as installing WSH. You can include it on your install CD (just get free permission from MS) and even do the install silently.
>>
>>Cheers,
>>
>>Andrew
>>

>>>Works great on my PC with 98 on it. But scripting host is not on other PCs here. This is going to be used in a commercial financial package so has to run on anything.
>>>
>>>Thanks anyway,
>>>
>>>>Nigel,
>>>>
>>>>
* create an instance of the WSH Shell object
>>>>local loShell
>>>>loShell = createobject('wscript.shell')
>>>>* 0 = minimised window for the command, .t. = wait for a return value
>>>>lnResult = loShell.Run(m.lcCommandLine, 0, .t.)
>>>>
>>>>
>>>>Cheers,
>>>>
>>>>Andrew
>>>>

>>>>>I need to call an old 16bit exe file so I'm using ShellExecute. The only problem is that I also need to wait for completion of this third-party executable before my VFP app can continue processing.
>>>>>
>>>>>Any ideas?
>>>>>
>>>>>TIA,
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform