[RESOLVED] Check if this is the last instance of an appliction on closing.
To close a independend application (a Chat program)
I need to know if my application is the last instance of this application running on a system.
I can of course iterate through all proccesses, but I was hoping there would be a simpler way to achive this task.
Using Counters to keep track of the number of instances is not a way 'I want to go, for it would flaw on a crash of any instance.
A mutex would be a problem if the first instance is closed first...
Does anyone know a simple straightforward solution to this problem?
Thanks in advance,
Re: Check if this is the last instance of an appliction on closing.
vb.net Code:
If Process.GetProcessesByName("process name here").Length = 1 Then
'This is the last instance.
End If
Re: Check if this is the last instance of an appliction on closing.
Thx,
I will look into this concept tommorrow
See Ya!
Dnereb