s Long, _
                                      ByVal wParam As Long, _
                                      ByVal lParam As Long) As Long
   Select Case iMsg
   Case WM_CHANGECBCHAIN
      ' If the next viewer window is closing, repair the chain:
      m_hWndNextViewer = lParam
      If (m_hWndNextViewer &lt;&gt; 0) Then
         ' Otherwise if there is a next window, pass the message on:
         SendMessageByLong m_hWndNextViewer, iMsg, wParam, lParam
      End If
      ISubclass_WindowProc = 0
        