Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Multiple instances

How do you keep a person from opening several instances
of a program? The previnstance wants an object as the
parameter, not an exe name....
0
WPentecost
Asked:
WPentecost
  • 2
1 Solution
 
MikeP090797Commented:
IF the program is yours, you need to use the App object, App.PrevInstance
0
 
vmanoCommented:
if you want the EXE name to be passed in as a parameter, then try FindWindow and SetFocus API calls.

vmano


0
 
dm_14Commented:
1. Place the following code in your apps Sub Main () or form_load procedure

if App.PrevInstance then
 msgbox "App is already available"
 end
end if

2. Try to run two instances of your app, the above message will be displayed and the program will terminate.

This will prevent a person from running multiple instances of a program.
0
 
MikeP090797Commented:
didn't I already suggest that?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now