Hi,
I encountered the same problem, and with some help and inspiration from I do not remember who, it was resolved by DDE-calls: works fantastic!
programming sample: (the application was called "MASCL.EXE")
*-----------------------
* Check if program is already running on this machine
*-----------------------
=DDESETOPTION('SAFETY',.F.)
checkval=DDEINITIATE('MASCL','System')
IF checkval#-1
=MESSAGEBOX("MASCL already running!",16)
QUIT
ENDIF
*-----------------------
* If OK: set DDE-flag
*-----------------------
=DDESETSERVICE('MASCL','DEFINE')
*********** mainprogram text comes here
** once you get here, no second instance can be called ...
** end off application:
*------------------------
* remove DDE-flag
*-----------------------
=DDESETSERVICE('MASCL','RELEASE')
I hope this helps,
Best regards from Belgium
Ivo Hubert
>The application resides on a network drive, and the user launches it from a desktop icon. Due to the 2-3 second start time, the impatient user tends to launch the application a second or third time. To make matters worse, the READ EVENTS of the first form prevents the READ EVENTS on the second form from starting and the user is looking with an inert (second) version of the form.
>
>I've tried wexist("MyScx_name") and wexist("MyScx_Caption") and neither are available to determine if the program is already running. Even if that worked, would the second launch be able to detect the first window if it hadn't yet opened?
>
>Is there a simple way to prevent multiple launches, or do I have to create a process that can check if the program is running?