See thread#
1001365>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