Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Only open application once
Message
From
30/11/2001 11:03:52
 
 
To
29/11/2001 10:28:51
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00585701
Message ID:
00588023
Views:
30
Thanks for the code, I'm currently using firstinstance.prg and that seems to be ok.

Kev
>I found this somewhere (don't remember where). It's small and works great. Basically, set the caption of _screen in your app and check for it:
>
>IF CheckWin('My Application')
> MESSAGEBOX('Application is already running.'+CHR(13);
> +'Please check your taskbar for the app'+CHR(13);
> +'and click on its button to maximize it.' ,48,'Application is already running!')
> RETURN .F.
>ENDIF
>*--Remember to set the caption in your app AFTER you check for it using checkwin
>*--or it will see itself running and checkwin will return positive
>_screen.caption="My Application"
>
>FUNCTION CheckWin
>* Routine which sees if an application is active by looking for its
>* Window title
>* expC1 Window title
>PARAMETER tcTitle
>DECLARE INTEGER FindWindow in Win32API as FindWindow STRING, STRING
>RETURN IIF(FindWindow(0,tcTitle)>0,.T.,.F.)
Previous
Reply
Map
View

Click here to load this message in the networking platform