Prevent Contextual menu if window open?

Hello,
Does anyone know of any way to prevent a contextual menu from displaying, if a certain window is open?

I have a ListBox with a contextual menu, but if someone right-clicks and for example selects “open window1”, the window opens - but if they then move the mouse back over the ListBox and right click again and choose “open window 2” - both windows are now open, instead of only 1.

I would like therefore, to prevent the contextual menu from working if there is already a certain window open.

thank you all in advance.

In your ListBox.ConstructContextualMenu event, check if the Window is open and if it is then Return False and do nothing else.