Event add #WM_ENDSESSION for save() etc.
Posted: Fri Apr 07, 2017 12:57 pm
Event add #WM_ENDSESSION for save() etc.
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
EnableExplicit
Define EventID
Procedure WinCallback(hWnd, uMsg, wParam, lParam)
If uMsg = #WM_ENDSESSION
;(my code)
;Windows wird heruntergefahren.
;Hier ké°Šnen noch wichtige Einstellungen gespeichert werden.
EndIf
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
SetWindowCallback(@WinCallback())
Repeat
EventID = WaitWindowEvent()
If EventID = #PB_Event_CloseWindow
End
EndIf
ForEver
EndIf