* Visual FoxPro doesn't natively provide a method to return an error level * to the operating system when terminating. It can be done using a call to the * Win32 API call ExitProcess(). VFP will immediately terminate and will return * the value of the parameter as the error level. DECLARE ExitProcess in Win32API INTEGER ExitCode * * 0 = Uncontrolled break, for example a crash. * 1 = Quit via [x] in upperright corner or via Windows Task Manager. * 2 = Quit via Quit-button or via ESC. ExitProcess( iif( m.glUserQuit, 2, 1 ) )Who knows of a way to see that the CloseButton was pressed?