Except Excel, which wants to act like single application with multiple windows.
For GUI apps it sends a WM_CLOSE, because that's they way to "close" a GUI application.
For console applications it sends a message through the "Console control handler". Which the console subsystem no longer lets the application properly handle and kills the process summarily anyway.
Note that I keep saying "application" because that has been the terminology in windows forever. "GUI apps" and "console apps" were a thing before mobile.