VCL Control Messages (Values): Parameters: Comments:
CM_BASE
($ B000)
CM_ACTIVATE NO Params Used When App is Actived or A
(Cm_base 0) Custom Form Is Modally Shown
CM_DEACTIVATE NO Params Counter Part To CM_Activate
(Cm_base 1)
CM_GOTFOCUS No params not available
(Cm_base 2)
CM_LOSTFOCUS NO params not available
(Cm_base 3)
Cm_cancelmode tcmcancelmode used to stop sales behaviour of
(Cm_base 4) Controls Like Tdblookup
CM_DIALOGKEY TCMDIALOGKEY Used in The Keypreview CHAIN OF A
(Cm_base 5) Form to Dermin WHETHER A CHILD
Control Processes Special Keys Like
Tab, Arrow Keys ETC.
Cm_dialogchar tcmdialogchar Same as cm_dialogkey But for
(Cm_base 6) Characters
Cm_focuschanged tcmfocuschanged buy in forms by the active
(Cm_base 7) Control Changes
CM_ParentFontChanged if wparam = 1 Then LPARAM
(Cm_base 8) Contains A TFONT Else Just
Use the font of the parent
Used in All Controls
Cm_parentcolorchanged if wparam = 1 THEN
(CM_BASE 9) LParam Contains a Colorelse Just Use The Color of
The Parent Used in All
CONTROLS
Cm_hittest TCMHITTEST Used Only At Design Time (AND "
(Cm_base 10) in controlpos) To Determine THE
Control at the capital mouse
Message.Result = 0 if Control
Considers Itself As Not Hit Else 1
CM_VisibleChanged WParam = 1 if Visible, Used When A Control's Visibility IS
(Cm_base 11) LParam Contains Changed by ITS Visible Property
CM_ENABLEDCHANGED NO Params Used WHEN A Control Is Enabled OR
(Cm_base 12) DISABED by ITS Enabled Property
Cm_colorchanged no params ready for WHEN A Control's Color IS
(Cm_base 13) Changed by ITS Color Property
CM_FONTCHANGED NO Params Used in The Tfont.Onchange
(CM_BASE 14) Event of a control's font
CM_CURSORCHANGED NO Params Used WHEN A Control's Cursor IS
(Cm_base 15) Changed by ITS CURSOR Property
CM_CTL3DCHANGED NO Params Used When Control's Ctrl3d
(Cm_base 16) Property Is Changed
CM_ParentctL3dchanged No params Used with activex control (cm_base 17) (onambientpropertychange), in
Response to a
Cm_ctrl3dchanged message
AND used when
TwinControl from a stream
CM_TextChanged no params Used WHEN A Control's Text IS
(Cm_base 18) Changed
CM_MOUSEENTER WPARAM = 0,
(Cm_base 19) lpaam = Sometimes
A Reference of the Control
Having the Mouse Pointer
Over it Sent by TAPPLICATION
And used intenally by
TSPEEDButton
CM_MouseLeave As in Counterpart To
(Cm_base 20) CM_MOUSEENTER CM_MOUSEENTER
Cm_Menuchanged No params Internal Message for Tmenu
(Cm_base 21) (When Merging or An Item HAS
Changed)
CM_AppKeyDown WParam = keycode, Sent Only when determining
(Cm_base 22) lpaam = keydata (LIKE IN WHETHER A KEY IS A MENU Key
WM_KeyDown)
Cm_appsyscommand wparam = 0, Sent in response to a
(Cm_base 23) LParam = @Message WM_SYSCOMMAND MESSAGE (Received by a twinControl)
Passing the entire message record
In lParam (useful in hint window
And by the application to focusitseelf)
Cm_ButtonPressed WParam = Group Index, Used INTERLY BY TSPEEDBUTTON
(Cm_base 24) LParam = Button Reference To Implement Button Groups
Cm_showingchanged no params Sent by TwinControl on Various
(CM_BASE 25) Events (Window Creation, Loading
From stream, new parent
Assignment, Used in Tcoolband
On Destroy and by Tmemostrings
On UpdateState Change
CM_ENTER TCMENTER SENT by TFORM WHEN THE FOCUS
(CM_BASE 26) Changes to another Child Control
And by Tapplication When IT Gets
The focus
CM_EXIT TCMEXIT SENT BY TFORM WHEN THE FOCUS
(Cm_base 27) Changes to Another Child
Cm_designhittest Tcmdesignhittest Special Message Never Sent from
(Cm_base 28) within the VCL (But from A
Designer DLL, Used Only At
Design Time to Determine WHETHER
A Control Wants Mouse and Key
INPUT. Message.Result = 1 if the
Control Behaves Like At Runtime
ELSE 0
Cm_ICONCHANGED NO params Sent by Tapplication from ITS
(Cm_base 29) ficon.onchange evenet
Cm_wantspecialkey tcmwantspecialkey slow by tcontrol in response to
(Cm_base 30) CN_KEYDOWN AND CN_KEYUPCM_INVOKEHELP WPARAM = Command, Sent by Tapplication To the Main
(Cm_base 31) LParam = Data Form on Help Invoking (nowhere
Used)
Cm_windowhook wparam = 0 if hooking service by Tapplication When A Form
(Cm_base 32) = 1 if unhonging hooks or unhatful
LPARAM = @@ hook window proc
CM_RELEASE NO Params Sent by TForm on Release of Itself
(Cm_base 33) and by tfinddialog gen to notify
ITS Redirector
Cm_showhintchanged no params used when a control's showhint
(Cm_base 34) Property is Changed
CM_ParentShowhintchanged No params Used At Various Places (in
(Cm_base 35) Response to a
Cm_showhintchanged
Message, When Reading a Controls
Data from A Street ETC.)
Cm_syscolorchange no params Sent in response to a
(Cm_base 36) WM_SYSCOLORCHANGE
Message (by TwinControl)
CM_Wininichange TWMWINICHANGE SENT by TwinControl in response
(Cm_base 37) to wm_wininichange
CM_FONTCHANGE NO Params Sent by TWINCONTROL IN Response (cm_base 38) to WM_FONTCHANGE
CM_TIMECHANGE NO Params Sent by TWINCONTROL IN Response
(Cm_base 39) to WM_TIMECHANGE
CM_TABSTOPCHANGED NO Params Used WHEN A Control's Tabstop
(Cm_base 40) Property Is Changed
CM_UIAACTIVATE NO Params Sent by Tcustomform When THE
(CM_BASE 41) Active Control Changes and IS USED
Primarily for ole controls
CM_UIDEACTIVATE NO Params Counterpart To CM_UIIAACTIVATE
(Cm_base 42)
CM_DOCWINDOWACTIVATE WPARAM = Active, Sent by TCUSTOMFORM ON
(Cm_base 43) lparam = 0 Activation / Deactivation to the THE
Current Ole Control if There's One
CM_ControlListChange WParam = Control, Sent by TwinControl On Inserting /
(Cm_base 44) lpaam = 1 if inserting removing a child control
ELSE 0
Cm_getdatalink no params slow by tdbctrlgrid to retrieve an
(CM_BASE 45) Eventual Data Link of A Control
(Message.Result Returns the link if
Applicable)
CM_CHILDKEY TCMCHILDKEY SENT by TWINCONTROL IN Response (cm_base 46) to cn_keydown and
CN_SYSKEYDOWN AND BY
TactivexControl When Translating Accelerator Keys
CM_DRAG TCMDRAG SENT BY Internal Drag Routines
(CM_BASE 47) (Controls.Pas) and used by
TwinControl to Trigger The Various Drag and Dock Events
Cm_hintshow wparam = 0, SENT by Tapplication on Hint
(Cm_base 48) lpaam = @thintinfo activity and on mouse
Messages
Cm_dialoghandle wparam = 0, SENT by Tapplication When
(Cm_base 49) LParam = Handle When Dialoghandle Is Read or Written To
Setting and the applications handle HAS
WPARAM = 1, Not Yet Been Created, When
LParam = 0 When Reading called the dialog handle the
Message.Result Contains the New
Handle
Cm_istoolcontrol no params slow by toleForm To Determine IF
(CM_BASE 50) ITS Child Controls Are Tool Controls,
Used Only by TCUSTompanel
CM_RecreateWnd No params Sent by
(Cm_base 51) TwinControl.RecreateWnd andTfieldDataLink.UpDaterightToleft
CM_INVALIDATE WPARAM = 1 if repaint is Sent by TwinControl.INValidate
(Cm_base 52) Required else 0, To Notify Itself and ITS Parent
LParam = 0 of the invalidation request
Cm_sysfontchanged no params Sent by Tscreen if ITS iconfont IS
(Cm_base 53) Changed and by TControl WHEN
Reading Properties from stream or
Changing DesktopFont
CM_ControlChange TcmControlChange Sent by TwinControl WHEN
(Cm_base 54) inserting or removing a child
CONTROL
Cm_changed wparam = 0, SENT by tcontrol.changed
(Cm_base 55) lparam = SELF
CM_DOCKCLIENT TCMDOCKCLIENT SENT by TWINCONTROL.DOCKDROP TO
(Cm_base 56) DETERMINE WHETHER DOCKING IS
ALLOWED or NOT
CM_undockClient TcmundockClient Sent by Tcontrol on Destroy, by
(Cm_base 57) TwinControl.doundock and
TCUSTOMDOCKFORM ON Removing a
Child Control
CM_FLOAT TCMFLOAT SENT BY INTER DRAG / DOCK ROUTINES
(Cm_base 58) To make a control floatingcm_borderchanged no params Sent by TwinControl When
(Cm_base 59) BorderWidth or BevelWidth Styles
Are Changed
Cm_bidimodechanged no params Sent by tcontrol.setbidimode
(Cm_base 60)
CM_ParentBidimodeChanged No Params Sent At Various Places (in
(Cm_base 61) Response to
CM_BIDIMODECHANGED, WHEN
Reading a Control from a stream,
When Reading a Custom from From
A stream, when bidimode of
Tapplication Changes and when
Tcustomrichedit is create
Cm_allchildrenflipped no params Sent By
(Cm_base 62) TwinControl.doflipChildren
CM_ActionUpdate wparam = 0, SENT by tcontainedaction.Update
(Cm_base 63) lparam = an action
CM_ActionExecute WPARAM = 0, SENT by tcontainedaction.execute
(Cm_base 64) lparam = an action
CM_HINTSHOWPAUSE WPARAM = 1 if Hint Was Sent by Tapplication ON MOUSE
(Cm_base 65) Active Messages, when's a new lparam = Time Interval Control Under The Mouse and HAS
When to show new hint showhint set to True
CM_DOCKNOTIFICATION TCMDOCNOTIFICATION SENT BY (CM_BASE 66) TControl.senddockNotification
Which is executed in response to
CM_VisibleChanged and
WM_SETTEXT
Cm_mousewheel tcmmousewheel meneral Mousewheel Message
(Cm_base 67) generated either by the registered
Mouse Wheel Message OR
WM_MOUSEWHEEL (Not
Win95) And Sent by TwinControl
VCL Control Notifications
VCL Control Notifications are just reflections of the corresponding WM_xxx messages. They are sent by a window to their parent window (not VCL but Windows). This makes in Delphi no sense as the parent knows basically nothing about its child windows and can therefore not handle them. Each of these messages contains in its lParam the handle of the child window which has sent the message. The VCL does nothing else then to add CN_BASE to the message value and sends the message then to the window which created it originally. This way Windows CAN Handle Their Special Messages Themselves.
Control NOTIFICATION VALUE
CN_BASE $ BC00
CN_CHAR CN_BASE WM_CHAR
CN_CHARTOITEM CN_BASE WM_CHARTOITEM
CN_COMMAND CN_BASE WM_COMMAND
CN_CompareItem CN_BASE WM_COMPAREM
CN_CTLCOLORBTN CN_BASE WM_CTLCOLORBTN
CN_CTLCOLORDLG CN_BASE WM_CTLCOLORDLG
CN_CTLCOLOREDIT CN_BASE WM_CTLCOLOREDITCN_CTLCOLORLSTBOX CN_BASE WM_CTLCOLORLISTBOX
CN_CTLCOLORMSGBOX CN_BASE WM_CTLCOLORMSGBOX
CN_CTLCOLORSCROLLBAR CN_BASE WM_CTLCOLORSCROLLBAR
CN_CTLCOLORSTATIC CN_BASE WM_CTLCOLORSTATIC
CN_DELETEITEM CN_BASE WM_DELETEIM
CN_DRAWITEM CN_BASE WM_DRAWITEM
CN_KEYDOWN CN_BASE WM_KEYDOWN
CN_KEYUP CN_BASE WM_KEYUP
CN_HSCROLL CN_BASE WM_HSCROLL
CN_MEASUREITEM CN_BASE WM_MEASUREITEM
CN_NOTIFY CN_BASE WM_NOTIFY
CN_PARENTNOTIFY CN_BASE WM_PARENTNOTIFY
CN_SYSKEYDOWN CN_BASE WM_SYSKEYDOWN
CN_SYSCHAR CN_BASE WM_SYSCHAR
CN_VKEYTOITEM CN_BASE WM_VKEYTOITEM
CN_VSCROLL CN_BASE WM_VSCROLL