Does anyone know how to detect when my application is being asked gracefully to shut down? I know you can't 'detect' TerminateProcess() as such, but when Windows gets shut down it asks apps to close gracefully and gives them time to 'clean up' before they either kill themselves or die to a delayed call to TerminateProcess
anyone know how to trap that? i was thinking something like this might work, but it doesnt:
------------------
anyone know how to trap that? i was thinking something like this might work, but it doesnt:
Code:
#Compile Exe #Include "Win32Api.Inc" CallBack Function DlgProc Select Case CbMsg Case %WM_QUIT: OPEN "C:\quitlog.txt" FOR APPEND AS #1 PRINT #1, "Quit at " & TIME$ CLOSE #1 End Select End Function Function PbMain Local hDlg As Long Dialog New 0 ,"Detect call to ExitProcess()",,, 200, 30, %WS_SYSMENU Or %WS_CAPTION Or %WS_MINIMIZEBOX To hDlg Dialog Show Modal hDlg, Call DlgProc End Function
------------------
Comment