by muststopmyths · 1mo ago · 0 comments
Well, I say "is used", but nothing in Windows is consistent anymore. Especially since web browsers started disrespecting the OS shortcuts. Now it seems like every application follows the web browser UI conventions instead of OS ones.
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.
Now, Alt+F4 didn't exist as a standard keyboard shortcut in Windows 1.0 - it was added later, but certainly by Windows 95 at the latest. And already in Windows 95, Alt+F4 was the "Close Active Window" shortcut, which would close the window or dialog that was currently active - not the entire application whose window this was. So pressing Alt+F4 on your keyboard while a "Save As" dialog was present in Word 95 would close that "Save As" dialog, it wouldn't close your Word document.
You can check the Windows Programming Guide to see how to create dialog windows or popup windows in the same app that already had a main window in Windows 1.03: https://archive.org/details/win103-sdk-manuals/5%20-%20Windo...
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.