|
-
Nov 19th, 2001, 03:37 AM
#1
Thread Starter
New Member
How can I check for my running program instance?
How can I check for my running program instance? Lets say I am running program prog1.exe, If I run it again, I want to have a messaga saying that the program is already running, How can Chech for this. Any hint is appretiated. Thanks.
-
Nov 19th, 2001, 04:36 AM
#2
if app.previnstance then
msgbox "Already running!"
end
end if
-
Nov 19th, 2001, 08:47 AM
#3
There might be occasions when you do want to allow multiple instances of your program, but would like to keep track of how many are running at once. If so, you can use this:
VB Code:
Dim Response As Variant
If App.PrevInstance = True Then
Response = MsgBox("Your program is already running. Do you wish to open a second instance?", vbYesNo + vbQuestion, "Already Running")
If Response = vbNo Then
End
End If
End If
'insert code to log a new instance and let the program continue
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
|