This message occurs if mouse input is not captured and the mouse causes cursor movement within a window.
wParam
Contains a handle to the window that contains the cursor.
lParam
Contains the hit-test area code in the low-order word and the mouse message number in the high-order word.
The DefWindowProc function passes the WM_SETCURSOR message to a parent window before processing. If the parent window returns TRUE, further processing is halted. Passing the message to a window's parent window gives the parent window control over the cursor's setting in a child window. The DefWindowProc function also uses this message to set the cursor to an arrow if it is not in the client area, or to the registered-class cursor if it is. If the low-order word of the lParam parameter is HTERROR and the high-order word of lParam is a mouse button-down message, the MessageBeep function is called.
The high-order word of lParam is zero when the window enters menu mode.
MessageBeep