GUI applications built with ExeOutput for PHP support several command line arguments (or switches). These allow you to control the application at launch, for example, to display a specific page when calling it from another program or from the Windows Run dialog.
GUI Applications Only
These switches apply only to GUI applications. For console applications, use PHP’s standard $argc and $argv variables to access command line arguments.
Command line switches are especially powerful when combined with the “Allow only one instance of the application” option (available in Security > Global Options). For example, if a single-instance application is already running, launching it again with a new page argument will not start a second instance. Instead, the existing instance will be brought to the foreground and will navigate to the new page specified in the command line.
Built-in Switches #
ExeOutput for PHP provides two built-in switches.
page #
Specifies the virtual path to the page that should be displayed when the application starts.
Syntax:
MyApp.exe page [path_to_page]
Examples:
MyApplication.exe page products.php
MyApplication.exe page "customer data/profile.html"
If the path contains spaces, you must enclose it in double quotes (").
ignoreuserpos #
Forces the application to open centered on the primary monitor, ignoring any previously saved window position. This is useful in situations where an application might launch off-screen. For instance, if a user moves the application to a secondary monitor that is later disconnected, the OS may try to launch the window in that “lost” position.
Syntax:
MyApp.exe ignoreuserpos
Creating Custom Switches #
You can create your own custom command line switches by reading and parsing the launch parameters with HEScript. This is accomplished using the ParamStr and ParamCount HEScript functions, which work similarly to their Delphi/Pascal counterparts.