Close Desktop Intercept Event

I have a project where there is occasionally a second desktop is open for a client. I am looking for a way to mimic the client intercept event script but just for when the second desktop is trying to be closed by hitting the “X” in the upper right corner. I just want there to be a confirm message box popup. Thanks in advance for any help or thoughts.

I hope someone else can give some more details, but Ignition is built on Java Swing. So all methods for things like JFrames are theoretically available - I’ve done things like disabling menu buttons on the top menu bar, and changing the icon for the window (getting the overall window using SwingUtilities.getWindowAncestor(component)).

From here, you can do something like whats shown here, but you’d have to translate that to Python.

Also you should know that none of this is supported by IA through their support channels.

Thanks,for the quick reply. Do you know if it is possible to remove the “X” button on the window? if i can then i can put the close function on a button on the screen which would make adding the confirm functionality a breeze.