The start-up Form in a VB6 app is Form1. This Form has a TreeView. When any node in the TreeView is right-clicked, a menu pops-up. Clicking a menu item opens another Form named Form2 which should be a modal Form. Users can open multiple instances of Form1. This is how I am invoking Form2:

Code:
Form1:

Private Sub mnuTV_Click()
    Dim frm As Form2

    Set frm = New Form2
    If Not (TreeView1.SelectedItem Is Nothing) Then
        Call frm.ShowMe(Me, TreeView1.SelectedItem)
    End If
End Sub

Form2:

Private frmOwner As Form

Public Sub ShowMe(OwnerForm As Form, TNode As MSComctlLib.Node)
    Set frmOwner = OwnerForm
    Me.Show vbModeless, frmOwner
    frmOwner.Enabled = False
    Call GetTVNodeSelected(TNode)
End Sub

Sub GetTVNodeSelected(Node As MSComctlLib.Node)
    Dim str1 As String
    Dim str2 As String

    str1 = Node.Text
    str2 = Node.Tag

    'more code here
End Sub

Private Sub Form_Unload(Cancel As Integer)
    On Error Resume Next
    frmOwner.Enabled = True
    Unload Me
End Sub
The reason I am not using the code

Code:
Form2.Show 1, Me
to invoke Form2 (in the mnuTV_Click() sub) in Form1 is because since users can open multiple instances of Form1 (which means multiple TreeViews can be visible at the same time), assuming that 2 instances of Form1 are open, when Form2 is invoked in any of the 2 instances, it will act as a modal window for both the instances of Form1 instead of being a modal window for only that instance of Form1 from which Form2 has been invoked.

But under some conditions I find that even though all instances of Form1 & Form2 are closed, the app doesn't unload completely. An instance of Form1 still continues running & its icon in the Taskbar still exists.

How do I ensure that when all instances of Form1[ & Form2 are closed, the entire app gets unloaded?

Note that this doesn't happen always; only sometimes. I couldn't unearth under what circumstances does this happen. Moreover, if Form2 is never invoked & multiple instances of Form1 are open, then closing each instance of Form1 unloads the app completely. This happens only when Form2 is invoked; so I guess it is Form2 which doesn't unload itself even after all instances of Form1 & Form2 have been closed.