This snippet is a message loop of sorts, but it does not terminate the application.
While GetMessage(Msg, %NULL, 0, 0)
If Msg.wParam=%WM_QUIT Then Exit Loop
TranslateMessage Msg
DispatchMessage Msg
Wend
Function = Msg.wParam
If Msg.wParam=%WM_QUIT Then Call PostQuitMessage (Msg.wParam)
On quitting, the screen returns to the code page in the IDE (or the desktop if running the exe directly) but Ctrl+Alt+Del shows that the app is still running, and it then has to be terminated by quitting it in that window and the one it brings up in turn.
The above additions re WM_QUIT is from Windows API help.
The code sits at the tail of the main dialog and should not be there at all, since this on is modal. But on quitting a subsequent MODELESS sub-dialog, the intention is NOT to quit the app.
What is the correct way to terminate an app, please, anybody?
While GetMessage(Msg, %NULL, 0, 0)
If Msg.wParam=%WM_QUIT Then Exit Loop
TranslateMessage Msg
DispatchMessage Msg
Wend
Function = Msg.wParam
If Msg.wParam=%WM_QUIT Then Call PostQuitMessage (Msg.wParam)
On quitting, the screen returns to the code page in the IDE (or the desktop if running the exe directly) but Ctrl+Alt+Del shows that the app is still running, and it then has to be terminated by quitting it in that window and the one it brings up in turn.
The above additions re WM_QUIT is from Windows API help.
The code sits at the tail of the main dialog and should not be there at all, since this on is modal. But on quitting a subsequent MODELESS sub-dialog, the intention is NOT to quit the app.
What is the correct way to terminate an app, please, anybody?
Comment