Reference Codebot.Unique.pas
Part of the Codebot package
The Codebot.Unique unit makes sure only one copy of your program runs at a time. Call UniqueInstance with a key, or with a string that is hashed into a key, when your program starts. It listens on a local port to find out whether another copy is already running, and Original tells you whether yours is the first.
Later copies can call SendMessage to pass something to the first copy, such as the files the user asked to open, and the first copy receives it on the main thread through OnMessage.
Items 8 items
| Name | Kind | Line |
|---|---|---|
| TMessageEvent | procedural | 24 |
| TUniqueInstance | class | 32 |
| Create | constructor | 44 |
| Destroy | destructor | 45 |
| SendMessage | procedure | 47 |
| OnMessage | property | 52 |
| Original | property | 49 |
| UniqueInstance | function | 56, 58 |