Windows uses the messaging model. The operating system communicates with your application window, passing messages to it. A message is simply a digital code that indicates a specific event. For example, if the user presses the left mouse button, the window receives a message with the following message code.
Some messages have data associated with them. For example, the WM_LBUTTONDOWN message includes the x coordinate and y coordinate of the mouse cursor.
To send a message to a window, the operating system calls the window procedure registered for that window. (And now you know what the window procedure is for.), For the Details mode, you can read this article, Messages in the window
source share