I set the code below in windows CancelClose event (with a set of boolean to set its excecution only when the user ask for the application to quit).
For Win_Idx = WindowCount To 1
If Window(Win_Idx) IsA wMain Then
But the second If is always false even when I see one or more (instances of) wMain.
PS: I had to move the code from Window.Close to Window.CancelClose because in Window.Close, WindowCount was always 0 even if I still saw it ! (behind a MsgBox !).