Download Now
Forums

    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

    NameKindLine
    TMessageEventprocedural24
    TUniqueInstanceclass32
    Createconstructor44
    Destroydestructor45
    SendMessageprocedure47
    OnMessageproperty52
    Originalproperty49
    UniqueInstancefunction56, 58