An older instance of this script is already running popup

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

How can I incorporate this into my application?
appalreadyrunningpopup.png
You do not have the required permissions to view the files attached to this post.
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

If you mean you only want 1 instance of your software to run then you need to check the 'Make single instance application' box in project properties and to have an alert when the user tries to run it more than once you need to add a next instance handler to the ApplicationEvents.vb file within the MyApplication class like this:
Code: Select all
        Private Sub SNI(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs) Handles Me.StartupNextInstance
            MsgBox("Already Running")
        End Sub
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

ok thanks again bro, this will definitely come in handy.
3 posts Page 1 of 1
Return to “Coding Help & Support”