Click here to Skip to main content
15,892,072 members
Articles / Web Development / CSS
Article

Single Instance Application A Simple Way!

Rate me:
Please Sign up or sign in to vote.
1.71/5 (13 votes)
18 Jan 2008CPOL 24.4K   218   22   4
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions

 
GeneralMy vote of 1 Pin
AlphaBeta011024-Aug-12 2:00
AlphaBeta011024-Aug-12 2:00 
GeneralThanks Pin
Catalin Radoi14-Feb-08 5:25
Catalin Radoi14-Feb-08 5:25 
Generalgreat first effort Pin
tgueth22-Jan-08 3:28
professionaltgueth22-Jan-08 3:28 
GeneralHmm very right. Pin
M.K.A. Monster19-Jan-08 3:09
M.K.A. Monster19-Jan-08 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.