Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShellExcute weirdness in VFP9
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01555101
Message ID:
01555487
Vues:
147
I don't think your problem is VFP in this case. ShellExecute only submits the application URL - it doesn't actually run the operation that's firing nor does it wait for its completion. In effect VFP is just a launcher and program flow immediately returns. The return value you get merely specifies whether the app in question could be launched.

So whatever UI behavior you are seeing comes from whatever is running in the background.

If you want more control over the process or you need to run a process modally you can use the Windows API and CreateProcess or CreateProcessEx functions to allow more control including the ability to wait for whatever application you're launching to complete.

You can also play around with the RUN command and the /N option which allows more control over how the launched application is displayed.

+++ Rick ---

>Hi again, Gang!
>
>Here is a snippet of code in an executable, called LDM.exe.
>
>
>lcExe = "SpoolZebra.Exe"
>lcPrinter = SET("PRINTER",2)
>lcDefaultLoc = SYS(5) + SYS(2003) + "\"
>lcFileName = "/" + lcFileName + "/"
>ShellExecute(0,"open",lcExe,lcFileName + lcPrinter,lcDefaultLoc,2)
>
>
>When run in VFP8 SP1, the ShellExecute opens the program SpoolZebra.exe and minimizes it immediately to the taskbar and runs it (prints a document).
>
>When run in VFP9 SP2, it minimizes, then pops back up to Normal size and prints the document. (BAD BAD BAD !!! That interfers with the normal program flow.).
>
>--------------------------------
>
>I changed the 2 to a 7 in the ShellExecute to see if it would stay minimized.
>
>It did, but it DID NOT PRINT !! Weird !! Why would it not print in this case???
>
>---------------------------------
>
>So, bascially, we want it to stay minimized, yet print the document.
>
>So, any ideas what is going wrong here?
>
>Thanks everyone!!!
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform