Window Closing event is called many times

I need user to confirm if he/she really wants to close the window of my command so add a messagebox in Window Closing event handler method.

It works well if I click the Close button or “X” button in the window, but if I right-click in blank area, Window Closing event will be called many times so the messagebox will appear many times.

The expected result is that Window Closing event is called only once, and my code can control if the window should be closed or not like clicking the Close button or “X” button in the window.

I’v attached my simplified test code and a video to show the issue. My Rhino version is 7.4. Thank you in advance.

RhinoCommonIssueTest.7z (2.6 MB)

It is hard to say how cracked versions of Rhino work, we won’t support such versions.

You should buy a valid license, and also ensure you are always on the latest service release. That way we have a better chance of finding out what the problem may be if it turns out it exists in a non-cracked version too.

1 Like

Hello, thank you for your reply. I’ve re-tested the issue using a non-cracked Rhino 6.35 and the issue is still reproducible.

Please check the attachment for details.

WindowCloseIssue.7z (3.4 MB)