Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detect multiple activation of form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00878119
Message ID:
00878343
Views:
15
>What is the simpliest and most reliable method of detecting if a specific screen is already active in a given session to prevent mulitiple launches of a modeless screen?

Within an application:
In the INIT of the application I declare variables for all forms. E.g.
private goMainWindow, goOptionsWindow
store NULL to goMainForm, goOptionsForm
The call of a form takes this code:
if not isnull( goOptionsForm )
   *
   * other scenarios are possible of course
   with goOptionsForm
       if .windowstate = 1
           .windowstate = 0
       endif
       .show()
   endwith
else
   do form Options name goOptionsForm
endif
In the menu you can skip/disable an option by testing the variable, e.g. skip if not isnull( goOptionsForm )

There's also the problem of not wanting the user to start another instance of the whole application. If that's your problem, then please tell so.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Reply
Map
View

Click here to load this message in the networking platform