|
-
Oct 5th, 2007, 01:36 AM
#1
Thread Starter
Junior Member
[RESOLVED] "Code to check if there is another instance of program running works on XP but not o
Hi All i am facing an issue with Vista.
I have logged in as administrator also but the following line is generating an exception which was working correctly earlier in XP & 2000
" (Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) "
I know its due to the security features added by Vista because when I disable UAC in Vista its working perfectly.
Can anybody help me in this case
I am pasting the whole code
Public Const gsResourceNamespace As String = "NBXCAS"
If gbMultipleAppInstances(gsResourceNamespace) Then
psErrorMessage = "Not allowed to have multiple instances of: " & gsApplicationDisplayName
Call mDisplayStartupError(psErrorMessage, MsgBoxStyle.ApplicationModal + MsgBoxStyle.Exclamation)
End
End If
Public Function gbMultipleAppInstances(ByVal vsWindowCaption As String) As Boolean
Return (UBound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0)
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|