Help with Win32: PostQuitMessage(0) doesn't post WM_QUIT apparently, because the message loop is not exited.

Mike Parker aldacron at gmail.com
Fri Aug 13 03:05:22 UTC 2021


On Friday, 13 August 2021 at 00:30:59 UTC, Ruby The Roobster 
wrote:

>
> When I run the program and close the window, the program still 
> runs in background mode.  I don't know why this happens nor how 
> to fix it.  Does anybody know what's going on?

frame beat me to it, but it may well be that you're getting -1. 
[The documentation][1] says that a window that has already been 
destroyed will result in the `hWnd` parameter being invalid, 
which will cause the function to return -1.


[1]: 
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmessage#return-value


More information about the Digitalmars-d-learn mailing list