Sign in Join
FPDoc Onlineexperiment

SingleInstance unit

Unit to run only a single instance in your application.

Singleinstance contains the basic abstract definition of a class TBaseSingleInstance that, when instantiated, will make sure only 1 instance of your application will be running. It is an abstract instance, you need to instantiate a descendent such as can be found in the advancedsingleinstance unit.

In this document, the first started instance of an application is called the Server, any application started later is called a Client application.

The single instance functionality also provides a mechanism to communicate parameters from the client to the server. For example, an editor started a second time may wish to pass any filenames to be opened to the server instance.

Classes and records

ESingleInstanceclassException raised in case of errors.
TBaseSingleInstanceclassAbstract class for single application instance.

Types

TBaseSingleInstanceClasstypeclass of TBaseSingleInstance.
TSingleInstanceParamsEventprocedure typeCallback type for the TBaseSingleInstance.OnServerReceivedParams event.
TSingleInstanceStartenumerationResult type for the call.

Variables

DefaultSingleInstanceClassvariableClass to instantiate when creating a TBaseSingleInstance instance.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.