Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing an app to be started twice
Message
From
26/11/1996 18:12:27
 
 
To
26/11/1996 16:03:48
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00013585
Message ID:
00013650
Views:
35
>>Is ther anyone out ther ewho can tell me how to prevent an app from starting twice (By users). A neat way please using temp tables and so on i know but there must be a easier way.
>
>Dave is right. This has been dicussed many times. But, here the info. The best solution is to have it at the icon level so no change in your FoxPro code. The icon should call a small C exe which will detect if your application is running, if yes switch to it, if no open it. Many people on the Universal Thread are using a C program which was done by a C programmer that works well with Visual FoxPro. Do you want the contact information?

C propgram is fine but the quickest way it's may be API call:
DECLARE INTEGER FindWindow in win32api INTEGER,STRING
if FindWindow(0,oSystem.Apptitle)<>0
QUIT
endif
Put this code to first lines of your App but after oSystem app object created.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform