WM_CLOSE will close a window, a process might have several windows or in fact no window at all (in which case you don't have anything to send the WM_CLOSE message to ).