This function launches an external executable and returns a handle that can be used for interaction.
Name | Description |
---|---|
path | file path of the executable to launch |
commandline | optional command line to pass to the program |
If the program was launched a new process is returned, otherwise NULL is returned.
#include "UltraEngine.h"
using namespace UltraEngine;
int main(int argc, const char* argv[])
{
Print("Launching process");
#ifdef _WIN32
auto proc = CreateProcess("C:/Windows/notepad.exe");
#endif
Print("Process running");
int exitcode = proc->Wait();
Print("Process ended (" + String(exitcode) + ")");
return 0;
}