Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Remove all Open windows in application
Message
 
 
To
03/10/2001 10:26:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00563589
Message ID:
00563598
Views:
16
>Hi all
>
>How to remove all open windows in an application to do the reindex routine.
>
>Txs

One way:
local lxx
for lxx = _Screen.FormCount to 1 step -1
   if upper(_Screen.Forms[lxx].BaseClass) = 'FORM' then
      * disregard toolbars
      _Screen.Forms[lxx].Release
   endif
endfor
Notice you have to go backward using the Forms collection of _Screen. As you release forms, the collection is decreased by one form and at some point, you will get record out of range going forward.

Of course this doesn't check to see if the user is actually doing anything in the form. You could add a call to the form's QueryUnload and if it returns .T> then release it. Otherwise, display a message to the user to get out of what they are doing.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform