Microsoft is really conservative in its APIs, so you can be sure that WM_APP messages through 0xBFFF do not conflict with system messages. This rule will require major changes to the Windows API, and many other applications will not survive.
The only relevant question: do you need to use messages in the WM_USER range or in the WM_APP range?
MSDN says :
Message numbers in the second range (WM_USER through 0x7FFF) can be determined and used by the application to send messages in the private window class. These values ββcannot be used to define messages that make sense throughout the application, because some predefined window classes already define values ββin this range. For example, predefined management classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX can use these values. Messages in this range should not be sent to other applications if the applications are not intended for messaging and in order to give the same value to message numbers.
Message numbers in the third range (from 0x8000 to 0xBFFF) are available for applications that will be used as private messages. Messages in this range do not conflict with system messages.
(my emphasis)
If you explicitly place these messages in a window that is designed to process them in a certain way and is not a subclass of the Windows control, you can use the WM_USER range. If they should be handled directly by the message loop (e.g. WM_QUIT for example) or if in doubt, use the WP_APP range.
In other words, since you do not need a lot of such messages, and you want to send them to the message queue of the user interface stream, just use one of the WM_APP range that is not yet used by your application, and be sure to write it down for later maintenance.
source share