Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Single Instance Application A Simple Way!

0.00/5 (No votes)
19 Jan 2008 1  
Making Single Instance Application a Simple Way!!

Introduction

This is a Simple method to make a Application Singleton.

Background

I had seen some Examples on Codeproject but those were a little complex this is the simple method.

Using the code

It is very simple to understand the programming i have done in this example.

	
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Process.GetProcessesByName(Process.GetCurrentProcess.ProcessName).Length() > 1 Then
            MsgBox("This is a Single instance Applicaton " & vbNewLine & "* Another Instance is Already Running", MsgBoxStyle.OKOnly, "Single Instance Application")
            End
        End If
    End Sub

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here