Application

Launching Applications

Open launches the application at the specified path and returns the Application instance for fluent chaining. WithParameter adds a command-line argument that is passed to the executable at launch. WithName assigns a friendly identifier to the application instance - useful when managing multiple application objects. Close terminates the running application. ToGPALObject returns the typed interface for dependency injection or storage. WithUseHardware makes every selector in the application session use real OS level mouse and keyboard input.

Examples

GPAL Fluent: High-level fluent C# API

//WithParameter must be called before Open - it configures the launch arguments that are passed when the process starts. WithName is optional but helps identify the instance in log output.

// Open Notepad and interact with it

GPAL.Application

.Open("C:\Windows\notepad.exe")

.WithSelector(GPAL.Selector.WithName("Text Editor").ToGPALObject())

.SendString("Hello from GPAL!");


// Open an app with a command-line argument

GPAL.Application

.WithParameter("--config=prod")

.Open("C:\MyApp\app.exe");


// Store the application object for later use

var app = GPAL.Application

.WithName("MyApp")

.Open("C:\MyApp\app.exe")

.ToGPALObject();


// ... do work ...

app.Close();

💬 Ask GPAL