Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Application running more than once
Message
De
19/08/2005 15:39:02
 
 
À
19/08/2005 15:15:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01042387
Message ID:
01042394
Vues:
19
Hi Juan,

there are multiple ways of achieving this. Three that I can think of off the top of my head are:

1. check for existence of a file when your app starts, if not found, create it, if found then exit, delete the file when exiting. The problem is if your exe crashes, the file gets left behind and u need to delete the file manually.

2. lock a record in a local table when your app starts, if it can't get a lock, then exit.

3. use the windows api to check for a window with your app's title, if found, switch to it and exit your app, otherwise start your app. Check out this article: http://www.ml-consult.demon.co.uk/foxst-11.htm

>I dont want having more than one of the same application running in a computer. What code can I use in order for me to acomplish that???
>
>
>The thing is that when I make a program in Visual Fox pro, I build the executable and install a short cut in my desktop. When I open the shortcut, It opens the program, and runs it. But if i open it again, without closing the first one, it opens another window with the same program. If anyone has any code in order that when I already have the program running, when i try to open it again withouth closing the first one I opened, it doesnt let have Two programs of the same kind????????
>
>
>plz help
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform