Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close SPlash Screen EXE
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01258654
Message ID:
01258666
Vues:
12
This message has been marked as the solution to the initial question of the thread.
>I have opened a splash screen with ShellExecute from within my VFP app.
>
>How do I close it from within VFP?

One option is using WMI like this
DECLARE INTEGER ShellExecute IN shell32; 
    INTEGER hwnd,; 
    STRING  lpOperation,; 
    STRING  lpFile,; 
    STRING  lpParameters,;  
    STRING  lpDirectory,; 
    INTEGER nShowCmd

lcEXEName			= 'calc.exe'
ShellExecute(0, 'Open', lcEXEName, '', '', 0)

* Later on...
loLocator			= CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI				= loLocator.ConnectServer()
loProcesses			= loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] + lcEXEName + ['])

For Each objProcess in loProcesses
	objProcess.Terminate(0)
Next
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform