Lunch Terminal programmatically with the API CreateProcess

 

I need to lunch a terminal automatically with the API CreateProcess and afterwards close it with the API TerminateProcess.

Please could someboyd show me how to declare them and later on call them in MQL.

The VB statement of CreateProcess is:

Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA"

(ByVal lpApplicationName As String, ByVal lpCommandLine As String,

lpProcessAttributes As SECURITY_ATTRIBUTES,

lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long,

ByVal dwCreationFlags As Long,

lpEnvironment As Any,

ByVal lpCurrentDriectory As String,

l pStartupInfo As STARTUPINFO,

lpProcessInformation As PROCESS_INFORMATION) As Long

The VB statemetn of TerminateProcess is:

Declare Function TerminateProcess Lib "kernel32" Alias "TerminateProcess"

(ByVal hProcess As Long,

ByVal uExitCode As Long) As Long

Thank you,

Andres


Reason: