Difference between revisions of "UniqueInstance/fr"

From Free Pascal wiki
Jump to navigationJump to search
Line 26: Line 26:
 
Appelez la fonction InstanceRunning : elle retourne vrai si il y a déjà une instance en cours d'exécution. Il existe deux variantes: une avec un argument d'identification (String) et une sans. La seconde utilise le nom de l'exécutable comme Identifiant.
 
Appelez la fonction InstanceRunning : elle retourne vrai si il y a déjà une instance en cours d'exécution. Il existe deux variantes: une avec un argument d'identification (String) et une sans. La seconde utilise le nom de l'exécutable comme Identifiant.
  
=== Remarks ===
+
=== Remarques ===
* It was developed and tested under win32. I don't have a Linux machine at time (Testing under Ubuntu Linux and working fine. By liyuangarcia with date 08/05/2007)
+
* Il a été développé et testé sous win32. Je n'ai pas une machine Linux à l'heure actuelle (Essais sous Ubuntu Linux et cela fonctionne bien. Par liyuangarcia en la date du 08/05/2007)
 
* Although it does not use platform dependent code, the callback mechanic used to pass the command line probably won't work in Linux. This occurs because TSimpleIPCServer under Linux does not call the OnMessage event (At least until some months ago when i tested it).
 
* Although it does not use platform dependent code, the callback mechanic used to pass the command line probably won't work in Linux. This occurs because TSimpleIPCServer under Linux does not call the OnMessage event (At least until some months ago when i tested it).
 
* If you put two TUniqueInstance components in the same application with the same identifier your application wont load.
 
* If you put two TUniqueInstance components in the same application with the same identifier your application wont load.

Revision as of 00:37, 7 July 2009

Deutsch (de) English (en) español (es) français (fr) polski (pl)

À propos de

UniqueInstance fournit un moyen facile de forcer une seule instance par application fonctionnant en même temps.

Fonctions

  • Facile d'utilisation: il suffit de glisser un composant dans le formulaire(form) principal.
  • Fournit un mécanisme pour recevoir la ligne de commande des autres instances.

Comment utiliser(le composant)

Il suffit de le déposer dans le formulaire principal

Propriétés:

  • Enabled: Active / désactive le composant
  • Identifier: utilisés pour fournir un moyen d'identifier l'application

événement

  • OnOtherInstance: appelé si une autre instance est lancée. Reçoit les paramètres transmis à cette instance.

Comment utiliser (brut)

Ajouter l'unité uniqueinstanceraw à la section uses.

Appelez la fonction InstanceRunning : elle retourne vrai si il y a déjà une instance en cours d'exécution. Il existe deux variantes: une avec un argument d'identification (String) et une sans. La seconde utilise le nom de l'exécutable comme Identifiant.

Remarques

  • Il a été développé et testé sous win32. Je n'ai pas une machine Linux à l'heure actuelle (Essais sous Ubuntu Linux et cela fonctionne bien. Par liyuangarcia en la date du 08/05/2007)
  • Although it does not use platform dependent code, the callback mechanic used to pass the command line probably won't work in Linux. This occurs because TSimpleIPCServer under Linux does not call the OnMessage event (At least until some months ago when i tested it).
  • If you put two TUniqueInstance components in the same application with the same identifier your application wont load.
  • The Identifier is optional both to the function and the component. In the case it's not used, the executable name is used as a Identifier. The consequence is that if someone changes the exe name another instance will not be identified.
  • To make sure a application will not avoid other launching you can use a GUID as the Identifier

History

  • 16/12/06 - Initial release. See my blog to know how it began.

Author

Luiz Américo Pereira Câmara

License

Modified LGPL


Download

Lazarus CCR sourceforge.