Custom Server API References > Mercury.QTP.Slv.CustomServer Namespace > IRecord Interface > Methods > OnMessage Method
Handles Windows messages.

Remarks

This method is called during a recording session on any Windows message hooked by UFT according the filter returned by IRecord.GetWndMessageFilter.

Syntax

Visual Basic (Declaration) 
Overridable Function OnMessage( _
   ByVal src As DependencyObject, _
   ByVal msg As Integer, _
   ByVal wParam As Integer, _
   ByVal lParam As Integer _
) As RecordStatus
C# 
virtual RecordStatus OnMessage( 
   DependencyObject src,
   int msg,
   int wParam,
   int lParam
)

Parameters

src
The control to which the Windows message is targeted. This can be either the control that is served by this custom server, one of its children, or any other control. Which messages are handled depends on the value returned by GetWndMessageFilter.
msg
The integer value of the Windows message sent. For example, WM_LBUTTONDOWN is 0x0201.
wParam
The wParam parameter passed with the Windows message.
lParam
The lParam parameter passed with the Windows message.

Return Value

A RecordStatus value, indicating whether the custom server handled the message, or whether this message needs to be passed on to other registered event handlers.

See Also