Handle of my appilication?
Posted on 2007-04-02
I want to search for mutliple instances of my application.
So I am searching through all processes and if the exename is the same as my app-exename, I add currentinstances +1
if currentinstances > 1 then I want to kill all old instances
so I loop again through all processes and then if the exename is the same as my app exe-name, I want to compare the handles, to check if this instance is the actual running instance.
So I tried:
Dim prochandle As String = oprocess.Handle.ToString
Dim myhandle As String = Me.Handle.ToString
If prochandle <> myhandle Then
But this did not work, Me.Handle seems to be different from the Process.Handle of my application...
What is wrong?