Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Quit an Application
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00740696
Message ID:
00769872
Vues:
40
OK I will. This is in the parent code of the CM onShutdown mehtod. After it comes back from executing that parent code I put a wait window and at that point it's still got the applications Background, so I'm thinking that it's Windows that is doing this bad thing.
Here's the parent code:
***************
* Class Hierarchy for appapplication of c:\codemine\address\source\appmain.vcx
* 1. cmapplicationmanager of c:\codemine\common50\cmapp.vcx (Has Shutdown() method code)
* 2. cmserviceabstract of c:\codemine\common50\cmdataa.vcx
***************

* Method Code From "cmapplicationmanager" of c:\codemine\common50\cmapp.vcx
FUNCTION cmapplicationmanager.shutdown
LPARAMETERS lForced
*++
*>>Shut down the application.
*--
LOCAL oForm

* Don't allow shutdown if any modal forms are open. Check all forms, because a "modeless" form opened
* from within a modal one is really modal, even though it appears modeless.
FOR EACH oForm IN _SCREEN.Forms
IF TYPE('m.oForm.WindowType') = 'N' AND m.oForm.WindowType = 1 AND m.oForm.Visible
IF NOT ISNULL(THIS.oMessage)
LOCAL cMsg, cName
IF TYPE('_SCREEN.Activeform.Baseclass') = 'C'
m.cName = _SCREEN.Activeform.Caption
ELSE
m.cName = WONTOP()
ENDIF
m.cMsg = THIS.oMessage.TranslateString('%txtNoShutdown')
m.cMsg = THIS.oMessage.Format(m.cMsg, m.cName)
THIS.oMessage.FlashMessage(m.cMsg)
ENDIF
RETURN .F.
ENDIF
ENDFOR

IF NOT ISNULL(THIS.oStateManager)
* Exit the event loop only if all forms close successfully.
IF NOT THIS.BeforeShutdown() OR NOT THIS.oStateManager.CloseAllForms() ;
OR (NOT m.lForced AND NOT THIS.AfterShutdown())
RETURN .F.
ENDIF
ENDIF

* Success, or State manager is gone - clear shutdown handler and end event loop.
ON SHUTDOWN
CLEAR EVENTS
ENDFUNC
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform