31.1.11 Notification Messages

In the USER function there are many functions that send window messages; window messages constitute a very significant part of the available function. All messages in the Win3 function that are sent are synchronous. This means that the sender of the message does not continue executing until the receiver creates a reply to the message. This can cause problems – if a message is sent to a hung application, the sender will hang waiting on the receiver – a condition to be avoided where possible.

USER32 will differentiate between messages that need to be synchronous and messages that don't. Messages that need to be synchronous are messages that return specific values or messages that need to be executed before the sender can continue.

Messages that don't need to be synchronous are usually notification messages. These are messages sent to a window proc so it knows what is going on – no return value expected. For example, this would be the WM_ENABLE message to tell the app it is being disabled, the WM_SIZE message to tell the app it has just been sized, etc.

A new function is being introduced for these type of messages, called SendNotifyMessage (see programmers reference for in-depth detail). It is very similar to SendMessage except the sender returns immediately rather than waiting for a message reply. The receiver receives this message just as it always had – its window procedure is called directly.

Every message sent from USER32 that has a void return value will be sent as a notification message. This will not affect the receiver of these messages at all. It will affect the sender in that the sender will return right away; possibly before the receiver has processed the message.