When looking at Delphi source code, I often see messages declarations from the Windows API, such as
WM_NOTIFY. I would like to know the differences between them and when they should be used?
WM messages are used by the Win32 API, and end user code.
CN messages are used internally by the VCL.
When the VCL processes certain
WM notifications from the Win32 API, like
WM_NOTIFY, which are sent from a child control to its parent window, the VCL reflects them as
CN messages (
CN_NOTIFY) back to the child that sent them. This allows VCL controls to handle their own notifications.