Receive callback messages in main loop
Posted: Sat Mar 19, 2011 2:36 am
I wish a future release could let us receive event messages like #WM_QUERYENDSESSION in our main loop instead of having to code a callback to receive them. Thank you.
http://www.purebasic.com
https://www.purebasic.fr/english/
How were you planning to do this from the main loop, just curious?MSDN for WM_QUERYENDSESSION wrote:Return Values
If an application can terminate conveniently, it should return TRUE; otherwise, it should return FALSE.
I was just hoping something like this could be done:netmaestro wrote:How were you planning to do this from the main loop, just curious?
Code: Select all
If OpenWindow(0,100,150,450,200,"Windows shutdown detect",#PB_Window_SystemMenu)
Repeat
eventID=WaitWindowEvent()
If eventID = #WM_QUERYENDSESSION
;Do your stuff here
MessageRequester("","Oops! Windows are shuting down!!")
EndIf
Until eventID=#PB_Event_CloseWindow
EndIf
I guess my request, then, is: remove that insulation?netmaestro wrote:the Purebasic main loop can only insulate the coder from the simpler elements