Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between messages with CN and WM prefixes

When looking at Delphi source code, I often see messages declarations from the Windows API, such as CN_NOTIFY and WM_NOTIFY. I would like to know the differences between them and when they should be used?

like image 536
Felipe Morais Avatar asked Jul 29 '18 18:07

Felipe Morais


1 Answers

WM messages are used by the Win32 API, and end user code.

CM and CN messages are used internally by the VCL.

When the VCL processes certain WM notifications from the Win32 API, like WM_COMMAND and WM_NOTIFY, which are sent from a child control to its parent window, the VCL reflects them as CN messages (CN_COMMAND and CN_NOTIFY) back to the child that sent them. This allows VCL controls to handle their own notifications.

like image 185
Remy Lebeau Avatar answered Nov 06 '22 12:11

Remy Lebeau