• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

How to make sure only one process running?

I have a application, and I don't want user to start the same program with two instance.
How do I detect there is a instance already running?
0
chpchai
Asked:
chpchai
1 Solution
 
EDDYKTCommented:
Private Sub Form_Load()
If App.PrevInstance Then End
End Sub
0
 
chpchaiAuthor Commented:
How to terminate the program then?
0
 
LordSkitchCommented:
app.previnstance checks to see if itself is running, then if it is, end kills it

if   app.previnstance   then   end
if (program is running) then (quit)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now