Example of Overriding a Message Handler
Go Up to Overriding the Handler Method
For example, to override a component's handling of the WM_PAINT message, you redeclare the WMPaint method:
type
TMyComponent = class(...)
.
.
.
procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
end;
class PACKAGE TMyComponent : public TComponent
{
protected:
void __fastcall WMPaint(TWMPaint& Message);
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER(WM_PAINT, TWMPaint, WMPaint)
END_MESSAGE_MAP(TComponent)
};