 As Boolean
Dim bFIrst As Boolean
Dim iWInCOunt As Long
Dim sCap As String

    If (ctlPopMenu.MenuKey(ParentItemNumber) = "mnuWindowTOP") Then
        ' build a window menu:
        With ctlPopMenu
            .ClearSubMenusOfItem ParentItemNumber
            
            lIcon = ilsIcons.ListImages("CASCADEH").Index - 1
            .AddItem "&amp;Tile", "winTILE", , -8001, ParentItemNumber, lIcon,
             False, True
            lIcon = ilsIcons.ListImages("CASCADE").Index - 1
            .AddItem "&