Question about closing the app.

Ok I am fairly new to write apps destined for Windows (windows only). Most of my past Windows apps were ports of a Mac app to Windows. So I am not a Windows expert.

If my main window opens 1+ sub windows, and I close the app using File->Exit, the code in App.Close event fires off and closes all the sub windows. Now if I click on the [X] in the upper right hand corner of the same window, it closes but all my other windows dont close. the App.close event doesnt fire. Is this normal behavior?

Just curious.

That sounds correct to me.
You would want the app to close when the last open window closes. It doesnt care what you consider a main window.

If you are closing the ‘main’ window using the X, and you expect that to close the app, then add code to the
main window’s close event, to check what sub windows you created, save their data, close them, then allow the main window to close, and that should generate an app.close
If not, you call call app.quit yourself to be sure.

Thanks Jeff!

The IDE has this kind of set up.
There’s the main window which shows your project + things like plugin help & the language reference.
When a main windows is closed we check to see if there are any other main windows open and if not we quit to make the “quit when last window closed” behave as people expect (when I close the last project window the IE should quit)