GLX Application Framework > GLX Application Framework > Running A Single Instance On Windows

Running A Single Instance On Windows

By default on Windows a new instance of your Revolution application will be launched each time the user double-clicks on your application or otherwise initiates a successive launch. As a developer you can override this behavior by intercepting the relaunch message (see Revolution docs). This lesson shows how the framework can handle this for you.

This feature is not available on OS X since an application can only have one instance running.

Running a Single Instance

To limit your application to only one instance on Windows check the Single Instance checkbox. If this checkbox is checked and the the user attempts to launch your application while it is already running then the framework will intercept the relaunch message that is sent to the glxappLauncher stack (the stack used to build the standalone). After the framework determines if any files should be open the glxapp_relaunch and glxapp_openFiles messages will be sent to your application (see application stack script).

Comments (2)

Sunday Apr 06 at 02:36 PM Mark Rauterkus

Why?

Is it important to only run one instance of the stack?

Is there an example as to the reason when running ONLY one instance is necessary?

By default, should this be checked?

Does MAC only allow one instance by default?

Monday Apr 07 at 01:36 AM Trevor DeVore

I've updated the lesson description to provide a little more detail about what is going on and added a note about OS X.

Whether or not you want to run one instance depends on your application. Two examples:

* Kiosk apps
* If you are using a SQLite database as a file format you might not want the user to have the same database open by two instances of your application. Rather you could spawn two windows in your single instance application in order to allow the user to open two separate databases at once but disallow opening the same database.

Add your comment




E-Mail me when someone replies to this comment

Are you human?