g
   ' Find active form
   lhWnd = getActiveEnabledForegroundWindow()
   If Not (lhWnd = 0) Then
      ' Check all toolbars for one with a main menu
      ' that is owned by this form:
      Dim vlhWnd As Variant
      Dim ctl As vbalCommandBar
      For Each vlhWnd In m_colhWnd
         If ControlFromhWnd(vlhWnd, ctl) Then
            If (ctl.hWndParent = lhWnd) Then
               If (ctl.MainMenu) Then
                  If (ctl.Enabled) Then
                     FindActiveMenuControl = ctl.hWnd
         