The InSendMessage function specifies whether the current window procedure is processing a message that was sent from another thread by a call to the SendMessage function.
BOOL InSendMessage(VOID)
This function has no parameters.
If the window procedure is processing a message sent to it from another thread using the SendMessage function, the return value is nonzero.
If the window procedure is not processing a message sent to it from another thread using the SendMessage function, the return value is zero.