class Windows::Process

A class encapsulating a native Windows process.

Global Functions

Process Create (const string, const int)Starts a new process from a command line and returns the corresponding Process object.
DoEvents ()Performs window message processing for the calling application.

Methods

int Wait (const int)Causes the calling process to wait for this process for the specified number of milliseconds.
int WaitForExit ()Causes the calling process to wait indefinitely until this process has exited.

Properties

string CommandLine ()Returns the command line that was used to create this process.
int ExitCode ()Returns the exit code of this process.
Window MainWindow ()Returns the main window of the process.

Type Declaration

native class Windows::Process
{
    ["A class encapsulating a native Windows process."]
    function Process Create (const string cmd, const int windowState); ["Starts a new process from a command line and returns the corresponding Process object. For available 'windowState' values, see Window::ShowWindow()."]
    function DoEvents (); ["Performs window message processing for the calling application. This method must be called from the application's main thread only."]
    accessor string CommandLine (); ["Returns the command line that was used to create this process."]
    accessor int ExitCode (); ["Returns the exit code of this process. If the process is still running, returns ExitCode_StillActive."]
    method int Wait (const int millisec); ["Causes the calling process to wait for this process for the specified number of milliseconds. Returns Wait_Signaled if this process has exited during the wait, or Wait_TimeOut if the time has elapsed and this process is still running."]
    method int WaitForExit (); ["Causes the calling process to wait indefinitely until this process has exited."]
    accessor Window MainWindow (); ["Returns the main window of the process."]
    const int ExitCode_NoError = 0;
    const int ExitCode_StillActive = 259;
    const int Wait_Abandoned = 128;
    const int Wait_Signaled = 0;
    const int Wait_TimeOut = 258;
    const int Wait_Failed = -1;
}

Reference

function Process Create (const string cmd, const int windowState)

Starts a new process from a command line and returns the corresponding Process object.

For available 'windowState' values, see Window::ShowWindow().


function DoEvents ()

Performs window message processing for the calling application.

This method must be called from the application's main thread only.


method int Wait (const int millisec)

Causes the calling process to wait for this process for the specified number of milliseconds.

Returns Wait_Signaled if this process has exited during the wait, or Wait_TimeOut if the time has elapsed and this process is still running.


method int WaitForExit ()

Causes the calling process to wait indefinitely until this process has exited.


accessor string CommandLine ()

Returns the command line that was used to create this process.


accessor int ExitCode ()

Returns the exit code of this process.

If the process is still running, returns ExitCode_StillActive.


accessor Window MainWindow ()

Returns the main window of the process.