Class: Process
Lua
C++
Edit

Process::Wait

This method pauses the calling thread until the process finishes running and exits.

Syntax

Returns

Returns the process exit code.

Remarks

This method will close the handle to the finished process. You do not need to call Process::Close after calling this method.

Example

#include "Leadwerks.h"

using namespace Leadwerks;

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;
}
Copyright © 2006-2025 Leadwerks Software.
All rights reserved.
Leadwerks 4 Documentation