Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXE Single instance
Message
From
04/07/2002 04:19:06
Omar Jonsson
Baendasamtok Islands
Iceland
 
 
To
03/07/2002 10:18:04
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00674917
Message ID:
00675256
Views:
17
I tried this and it works well for me.
Thank you very much.




>There are many ways to do this. Here is how I do it:
>
>The title bar on the main screen of this app is "Policy Profiler 32"
>
>In top of the app's main.prg:
>
>
>With _Screen
>   .visible=.F.
>ENDWITH
>	
>IF CheckWin('Policy Profiler 32')
>   MESSAGEBOX('Policy Profiler is already running.'+CHR(13);
>	 +'Please check your taskbar for the app'+CHR(13);
>	 +'and click on its button to maximize it.' ,48,'Policy Profiler is already running!')
>   RETURN .F.
>ENDIF
>
>With _Screen
>   .visible=.T.
>ENDWITH
>
>*-------------------------------------------
>FUNCTION CheckWin
>PARAMETER tcTitle
>
>* Routine which sees if an application is active by looking for its
>* Window title
>* expC1 Window title
>
>DECLARE INTEGER FindWindow in Win32API as FindWindow STRING, STRING
>
>RETURN IIF(FindWindow(0,tcTitle)>0,.T.,.F.)
>
>
>
>>How can I prevent users from starting multiple instances of my application exe?
Previous
Reply
Map
View

Click here to load this message in the networking platform