> > >cMesaj = "The program automatically will be closed in ten seconds ..." >messagebox(cMesaj, 48, "The program is closing", 10000) >Keyboard '{CTRL+F4}' && this line is to close report preview window in session. But it is useless >QUIT && if there is a opened report preview window in a session, > && Program gives this mesaj only. "Cannot quit Visual Foxpro" >How about:
cMesaj = "The program automatically will be closed in ten seconds ..." messagebox(cMesaj, 48, "The program is closing", 10000) *** Invoke you usual cleaning routine QUITIf you don't have one (Grrr):
cMesaj = "The program automatically will be closed in ten seconds ..." messagebox(cMesaj, 48, "The program is closing", 10000) lnFormToClose = 1 FOR lnForm = 1 TO _screen.FormCount IF TYPE("_screen.Forms(lnFormToClose)") == "O" .AND. .NOT. ISNULL(_screen.Forms(lnFormToClose)) IF _screen.Forms(lnFormToClose).Baseclass == "Form" _screen.Forms(lnFormToClose).Release() ELSE lnFormToClose = lnFormToClose + 1 ENDIF ENDIF NEXT CLEAR EVENTS QUIT(not tested)