Community discussion forum

Prevent multiple VB application instances

This is a comment thread discussing Prevent multiple VB application instances
  • 9 years ago

    This thread is for discussions of Prevent multiple VB application instances.

  • Advertisement

    Simply the fastest line-level profiler for .NET ever

    “The low overhead means it has minimal impact on the execution of my program”
    Mark Everest, Development Team Leader, Renault F1 Team Ltd.

    Try out the new ANTS Profiler 4 for yourself. Download your 14-day trial now

  • 6 years ago

    Put this line in the subroutine where you program starts.


       'If application is already running then get out of here
       If App.PrevInstance = True Then End


  • 5 years ago

    hmmm, that is true, the advantage of the method shown here is the fact that FindWindow will give you the hWnd value for the other instance meaning that through subclassing you can send a message to the previous instance - very useful when the user opens a file and there is already an instance running.

Post a reply

Enter your message below

Sign in or Join us (it's free).