WM_NCHITTEST is for hit-testing, and hit-testing can happen for reasons other than the mouse being over your window
The message is sent to your window in order determine what part of the window corresponds to a particular point. The most common reason for this is that the mouse is over your window. Although triggers most often for mouse activity, that is not the only reason why somebody might want to ask, "What part of the window does this point correspond...