Posted By

indra on 01/01/11


Tagged

thread


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

monyskynet


Run just one instance application


 / Published in: VB.NET
 

  1. Public Function CheckInstanceOfApp() As Boolean
  2. Dim appProc() As Process
  3.  
  4.  
  5. Dim strModName, strProcName As String
  6. strModName = Process.GetCurrentProcess.MainModule.ModuleName
  7. strProcName = System.IO.Path.GetFileNameWithoutExtension(strModName)
  8.  
  9. appProc = Process.GetProcessesByName(strProcName)
  10.  
  11. If appProc.Length > 1 Then
  12. Return False
  13. End If
  14.  
  15. Return True
  16.  
  17. End Function

Report this snippet  

You need to login to post a comment.