Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close SPlash Screen EXE
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01258654
Message ID:
01258666
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform