Returning 0 from your WM_CLOSE handler has nothing to do with whether or not the program stops.

What causes the program to stop is calling DestroyWindow, which sends a WM_DESTROY message that you...