BTW, despite what Microsoft says here...


The WM_QUIT message is not associated with a window and wherefore will never be received through a window's window procedure. It is retrieved only by the GetMessage or PeekMessage functions.

I tested this when I was writing safe-subclass.cpp, and it appears that WM_QUIT is received in subclassed windows procedures.