Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow only one instance of an application to run?

Status
Not open for further replies.

vbkris

Programmer
Jan 20, 2003
5,994
0
0
IN
i have tried using FindWindowA. the drawback is that the title of my program simply keeps changing. i want a fucntion that uses form name rather than form caption. any way?
 
Just use:
If App.PrevInstance Then End
No winapi calls needed.

Remedy
 
Private Sub Form_Load()
If App.PrevInstance = True Then
MsgBox "APP's NAME is already running!", _
vbExclamation
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top