[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • 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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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