JCL Help:TJclAppInstances.CheckInstance

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Check the number of running instances.


Pascal

 public function CheckInstance(MaxInstances: Word; MaxSessionInstances: Word = 0; MaxUserInstances: Word = 0): Boolean;


Parameters

Parameters Description
MaxInstances: Word Maximum count of running instances


Return Value

If fewer than MaxInstances applications are running the result is True, otherwise the result is False.


Description

CheckInstance determines whether fewer than MaxInstances application instances are running. If this is true, the process is registered as a running instance and a notification is sent to all other running instances, otherwise the function does nothing. Note that unlike TJclAppInstances.CheckSingleInstance, the application is not terminated and none of the already running instances is brought to the foreground. It's up to the application programmer to decide what to do if the function fails. You could, for example, terminate the application yourself by calling TJclAppInstances.KillInstance.


See Also

TJclAppInstances.CheckSingleInstance TJclAppInstances.CheckMultipleInstances TJclAppInstances.KillInstance


About

Donator

Petr Vones


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page