f Not (m_hWndParent = 0) Then
      DetachMessage Me, m_hWndParent, WM_ACTIVATEAPP
   End If
   
   If (m_bInMiddleScroll) Then
      RemoveHook Me, WH_MOUSE
      m_bInMiddleScroll = False
   End If
   
   If Not (m_frmRefPoint Is Nothing) Then
      Unload m_frmRefPoint
      Set m_frmRefPoint = Nothing
   End If
   
   Screen.MousePointer = vbDefault
End Sub

Private Function GetParentFormhWNd(ByVal lHWnd As Long) As Long
Dim lhWndParent As Long
   lhWndParent = GetParent(lHWnd)
   Do While Not (lhWndPar