PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Petrus Vorster on February 18, 2015, 12:50:41 PM

Title: Allow only one instance of a program
Post by: Petrus Vorster on February 18, 2015, 12:50:41 PM
Just a recap please.
How do you allow only one instance of your program to run?
Title: Re: Allow only one instance of a program
Post by: Jean-pierre Leroy on February 18, 2015, 02:00:10 PM
Hi Petrus,

Just put this code in the FF_WINMAIN special function:


If FF_PrevInstance Then       
        Function = %True    'return %TRUE if you want the program to end.
        Exit Function
End If


You can add a message to inform the end user as well.

Regards,
Jean-Pierre
Title: Re: Allow only one instance of a program
Post by: Petrus Vorster on February 18, 2015, 05:38:41 PM
Thanks Jean_Pierre!