Well, if we're talking about traditional Windows behavior, there's no such thing as an app in the first place.
Some programs allowed multiple windows to be open at the same time (e.g. Notepad), and some didn't (e.g. Paint), but for those that did, they spawned each window as its own process. Closing the window closed the process. That two processes shared the same executable had no deeper meaning until Windows XP added taskbar grouping.
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.