DECLARE Integer ExitProcess IN Win32API ExitProcess()John
>PROCEDURE CloseApp > >WAIT WINDOW "System shutdown initiated." NOWAIT > >PRIVATE lans >lans=0 >lans=MESSAGEBOX('You have started shutting down your computer'+CHR(13); > +'without saving all information and exiting'+CHR(13); > +'Policy Profiler Windows first.'+CHR(13)+CHR(13); > +'If you continue, your changes will not be'+CHR(13); > +'saved and your computer will shutdown.'+CHR(13)+CHR(13); > +'Select OK to exit Policy Profiler and'+CHR(13); > +'shutdown your computer or select Cancel to abort'+CHR(13); > +'the shutdown and return to Policy Profiler to'+CHR(13); > +'save all changes first.'+CHR(13)+CHR(13); > +'Exit Policy Profiler Windows and shutdown computer?',1+32+256+4096,'System Shutdown Initiated') >IF lans<>1 && 1=OK > WAIT WINDOW "Shutdown aborted. Please save all changes and exit before shutting down." NOWAIT > RETURN && return to location in app to allow user to exit cleanly >ENDIF > >WAIT WINDOW "Shutting down Policy Profiler" NOWAIT > >DO signout > >FOR EACH loForm IN _VFP.FORMS > IF VARTYPE(loForm) = "O" > loForm.RELEASE() > ENDIF >ENDFOR > >CLEAR events >ON ESCAPE >ON ERROR >ON SHUTDOWN >CLOSE TABLES >RELEASE ALL > >QUIT >>and
>WAIT WINDOW "Shutting down Policy Profiler" NOWAIT > >DO signout > >PRIVATE llokay >llokay = .T. >FOR EACH loForm IN _VFP.FORMS > IF VARTYPE(loForm) = "O" > IF loform.QUERYUNLOAD() > loForm.RELEASE() > ELSE > STORE .F. TO llokay > ENDIF > ENDIF >ENDFOR >IF !llokay > =MESSAGEBOX('An Error Ocurred Attempting to Exit.',0+16+4096,'ERROR') > RETURN TO MASTER >ENDIF > >CLEAR events >ON ESCAPE >ON ERROR >ON SHUTDOWN >CLOSE TABLES >RELEASE ALL > >QUIT >