LindaRichard
Programmer
I use the following code to make sure that my program is not
already running when it is launched. The problem with this code is that it checks
the forms caption. I change the caption continuously
e.g. Radiogenic Isotope Database - U/Pb Data
or Radiogenic Isotope Database - Argon Data
Depending on what's being viewed. I can't figure
out how to check for Radiogenic Isotope Database in
the string. Any suggestions on how to get this to work
or an alternative method would also be fine.
Thanks
Linda Richard
*----------------------------------------------------------
* Check if a copy of this program is already running on this machine
*----------------------------------------------------------
*access the foxtools library, it contains certain required functions
SET LIBRARY TO FOXTOOLS
*find the current window
GetWind=RegFn("FindWindow","CC","I"
*get the application handle
apphand=CallFn(GetWind,0,"Radiogenic Isotope Database"
*if a handle is returned the program is already running
IF apphand<>0
*warn the user
MESSAGEBOX("This program is already running. Only one instance can run at a time.",16,"Returning to WINDOWS."
*an error has occured so end the program
End_The_Program() &&procedure located below
ENDIF
*remove the foxtools library
SET LIBRARY TO
already running when it is launched. The problem with this code is that it checks
the forms caption. I change the caption continuously
e.g. Radiogenic Isotope Database - U/Pb Data
or Radiogenic Isotope Database - Argon Data
Depending on what's being viewed. I can't figure
out how to check for Radiogenic Isotope Database in
the string. Any suggestions on how to get this to work
or an alternative method would also be fine.
Thanks
Linda Richard
*----------------------------------------------------------
* Check if a copy of this program is already running on this machine
*----------------------------------------------------------
*access the foxtools library, it contains certain required functions
SET LIBRARY TO FOXTOOLS
*find the current window
GetWind=RegFn("FindWindow","CC","I"
*get the application handle
apphand=CallFn(GetWind,0,"Radiogenic Isotope Database"
*if a handle is returned the program is already running
IF apphand<>0
*warn the user
MESSAGEBOX("This program is already running. Only one instance can run at a time.",16,"Returning to WINDOWS."
*an error has occured so end the program
End_The_Program() &&procedure located below
ENDIF
*remove the foxtools library
SET LIBRARY TO