How to close a .exe opened with ShellExecuteW

 

How do I close an exe opened with ShellExecuteW?

I've heard of ShellExecuteEx and TerminateProcess but I do not know what parameters to import. If anybody could also tell me where you find how to import other shell32 functions for use in MQL4.

#import "shell32.dll"
int ShellExecuteW(int hwnd,string Operation,string File,string Parameters,string Directory,int ShowCmd);
#import

ShellExecuteW(NULL,"open","C:\\Users\\Alko\\desktop\\test.exe","","",1);

//Exit test.exe
 
Alko: How do I close an exe opened with ShellExecuteW?
The process should close itself. A bat file calls exit.
 
William Roeder #:
The process should close itself. A bat file calls exit.
I didn't mean to put .bat its a .exe I was copying from another code example on here