Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking for single instance of a VFP exe
Message
From
23/05/1999 09:13:50
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00220668
Message ID:
00221881
Views:
15
>Thanks to you, Evan and James for the help. But I'm still pretty new to all this stuff, so maybe a little more direction would help.

Basically what the code does is to set a windows MUTEX (an object that can be owned by a single thread at any one time) and then adds a property to the window object of the application (so that we would be able to identify it later)
if the mutex creation failed - it means another thread (i.e. another instance of the application) had already created one so the application searches for the window that has the property (the one we defined earlier) and switches to it
The advantage of adding a poperty to the window is that you don't depend on the title of the application which can change esp. in document oriented applicatins

Arnon
Previous
Reply
Map
View

Click here to load this message in the networking platform