FileClose closes the wrong window

Sorry if I am not putting this clearly but I hope I get the necessary details here.
I have several document type windows (all are .Show and not .ShowModal) that I open and closing with a menuItem Fileclose works fine usually.
I have Mainwindow that can open the Prefwindow. I also have the StrtUpPrefs, which will (re)sets which Ini file is used.
The Mainwindow has one menubar, while the other 2 use a smaller version.

The StrtUpPrefs is the first window, but if one wants to reset the Ini then what happens is

  1. Open the PrefWindow and press a button that opens the StrtUpPrefs window. (This action also closes the MainWindow).
  2. Reset the Ini file.
  3. Close the window - which should make the PrefWindow active and verify the Ini. Code is Self.Close for close.

The FileClose works correctly with StrtUpPrefs the first time.
What I know is happening on the 2nd time around with the FileClose is the StrtUpPrefs menu EnableMenuItems is not firing when it is opening.
It is firing when it was the only window.

Also, when this goes wrong, StrtUpPrefs is Window(0).

I know enough (I hope) to be sure I cannot make EnableMenuItems fire.
What am I missing?

What is the frame type of StrtUpPrefs?

All 3 are document frame and not modal. Unless I’m missing something

Double checked. My only modals are dialogs

I solved my problem with 2 things.

I had replaced in the menu item shortcut a capital W, because I had seen shown the lower case letters in the compiled app. The capital W started it going to the wrong window, and I changed it back to a small w. Now it worked.

The other change is in the button which opened the StrtUpPrefs.Action had 2 lines of code.

StrtUpPrefs.show MainList.close
The last line was supposed to (and did) close the main window while finishing the button’s action items. For some reason, it was waiting until the window StrtUpPrefs actually closed.
So I moved that line to StrtUpPrefs.Open and it all worked like it was supposed to.