## Receiving startup events in single instance mode |
previous | up | next

| If you have enabled the single instance mode for your executable, the application can only be started once. For a GUI application, the existing application window is brought to front when a user executes the launcher another time. However, you might want to receive notifications about multiple startups together with the command line parameters. If you have associated you executable with a file extension, you will likely want to handle multiple invocations in the same instance of your application. Alternatively, you might want to perform some action when another startup occurs.

| With the install4j launcher client API you can write a class that implements the `com.install4j.api.launcher.Controller.StartupListener` interface and register it with `com.install4j.api.launcher.Controller.registerStartupListener(StartupListener startupListener)`. Your implementation of `startupPerformed(String parameters)` of the `StartupListener` interface will then be notified if another startup occurs. install4j's launcher client API is automatically available to an application deployed with install4j. For compiling your application, you need to add `i4jruntime.jar` to the classpath. `i4jruntime.jar` can be found in the `resource` directory of your install4j installation.