Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Posts
    2

    Unanswered: Preventing Duplicate Instances

    Is there a way to check if my program is already running, and if it is, close it?

  2. #2
    Join Date
    Feb 2006
    Posts
    2
    Guffah... I need help.

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You could use the windows api to check if a particular window title exists. Depends on what variables will remain static throughout instances of your application. Another possiblity is to include a sort of homebrew "lockfile" that you could toggle on load and exit of your application.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    It might make more sense to not open the new instance if a previous instance is running...

    At startup, check the state of App.PrevInstance
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Quote Originally Posted by loquin
    App.PrevInstance
    Handy. Thanks.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •