Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 05-24-2005, 16:44
goggles99 goggles99 is offline
Friend
 
Join Date: Aug 2004
Posts: 62
Rept. Given: 5
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 1
Thanks Rcvd at 4 Times in 4 Posts
goggles99 Reputation: 0
Arrow

hmm, for vb6 it can be done very simply using "App.PrevInstance".

Code:
Private Form_Load( )
     If App.PrevInstance Then
          Unload Me
     End If
End Sub
for vb.net it's a bit different, but this function should work
Code:
Function PrevInstance() As Boolean
If Ubound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess).ProcessName)) > 0 Then
     Return True 
Else 
     Return False  
End If
End Function
There is also a similar way to do it in vb.net here
http://www.thescarms.com/dotNet/SingleInstance.asp


Last edited by goggles99; 05-24-2005 at 16:47.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[C] NoDel (tool to prevent file deletion) Insid3Code Source Code 0 02-10-2015 16:38
Prevent browser from being killed nino General Discussion 4 01-10-2014 02:38


All times are GMT +8. The time now is 00:39.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )