SetTrap Method

Applies to:  Subclasser object, PowerForm control
See also:  ClearTrap method, TrapMessage method, Method and Function Index

Sets a message trap.

Syntax:

object.SetTrap(Message As Long)

The SetTrap method syntax has these parts:

Part Description
object The name of an object in the Applies to list.  If object is a SubClasser object, then the object must be declared using WithEvents in order to receive the TrapMessage event.
Message Message identifier of the message to be trapped.

Remarks:

Setting a message trap for a particular message identifier will cause a Subclasser object or PowerForm control to raise a TrapMessage each time the subclassed window receives a message with that identifier.

A TrapMessage event will not be raised for messages which are handled by the Subclasser object or PowerForm control.

The following messages are handled by the Subclasser object and PowerForm control, and cannot be used with SetTrap:

WM_ACTIVATEAPP
WM_CAPTURECHANGED
WM_COMPACTING
WM_CTLCOLORSCROLLBAR
WM_DISPLAYCHANGE
WM_EXITSIZEMOVE
WM_GETMINMAXINFO
WM_GETTEXT
WM_HSCROLL
WM_LBUTTONDBLCLK
WM_LBUTTONDOWN
WM_LBUTTONUP
WM_MBUTTONDBLCLK
WM_MBUTTONDOWN
WM_MBUTTONUP
WM_MOUSEMOVE
WM_MOVE
WM_MOVING
WM_NCDESTROY
WM_NCHITTEST
WM_NCLBUTTONDOWN
WM_NCMBUTTONDOWN
WM_NCRBUTTONDOWN
WM_RBUTTONDBLCLK
WM_RBUTTONDOWN
WM_RBUTTONUP
WM_SETTINGCHANGE
WM_SIZE
WM_SIZING
WM_STYLECHANGED
WM_SYSCOMMAND
WM_TIMECHANGE
WM_TIMER
WM_VSCROLL

 


Home

Copyright and Disclaimer