Results 1 to 4 of 4

Thread: Checking if an instance of your app is already running

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2001
    Location
    Manchester
    Posts
    51

    Checking if an instance of your app is already running

    I have written an application for a customer and they have by mistake opened the package several times on there machine. How can i check to see if my app is already running and then activate it.

  2. #2
    Fanatic Member Bonker Gudd's Avatar
    Join Date
    Mar 2000
    Location
    Saturn
    Posts
    748
    VB Code:
    1. ' Check for a previous instance of the application
    2.    If App.PrevInstance Then
    3.  
    4.       ' Display message to the user and terminate this instance
    5.       Call MsgBox ...
    6.  
    7.       End 'Terminate the application
    8.  
    9.    End If

  3. #3
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I'd check for App.PrevInstance in a Sub Main on startup and use an Exit Sub rather than an End.
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Re: Checking if an instance of your app is already running

    Originally posted by GUILogic
    How can i check to see if my app is already running and then activate it.
    http://www.vbworld.com/api/tip125.html

Posting Permissions

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



Click Here to Expand Forum to Full Width