MSDN reports that the RegisterWindowMessage () function is used only to register messages sent between processes. If a message is required for sending in one process, it can be safely selected from the WM_APP range through 0xBFFF.
However, in our code base, I often see that RegisterWindowMessage () is used for messages sent only as part of a single process. I believe this was done because of the perceived ease of use of RegisterWindowMessage (), since it does not require manually distributing message identifiers in the WM_APP..0xBFFF range.
Do I understand correctly that if many applications run on the same machine, and all of them call RegisterWindowMessage () with different lines, they can exhaust the range of message identifiers allowed to return by RegisterWindowMessage (), and for some of them it will simply return a value, indicating a failure? What could be a good reason to use RegisterWindowMessage () messages when there are enough WM_APP..0xBFFF messages?
source
share