Here is an example of what I mean:-
vbnet Code:
  1. Public Class Form2
  2.     Implements IMessageFilter
  3.  
  4.     <DebuggerStepThrough()> _
  5.     Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements System.Windows.Forms.IMessageFilter.PreFilterMessage
  6.  
  7.         'Left mouse button up
  8.         Dim WM_LBUTTONUP As Integer = &H202
  9.  
  10.         If Me.IsHandleCreated Then
  11.             If m.HWnd = Me.Handle AndAlso m.Msg = WM_LBUTTONUP Then
  12.                 Return ButtonUpFiltered(m)
  13.             End If
  14.         End If
  15.  
  16.         Return False
  17.     End Function
  18.  
  19.     Private Function ButtonUpFiltered(ByRef m As Message) As Boolean
  20.         MsgBox("Click On " + Me.Name)
  21.         Return False
  22.     End Function
  23.  
  24.  
  25.  
  26. End Class

Single stepping would completely ignore PreMessageFilter but it would step into ButtonUpFiltered if called by PreMessageFilter. That way you can debug the message filter only when certain messages are trapped and if you wish not to debug them at all you can add the DebuggerStepThrough attribute to the ButtonUpFiltered procedure too.