One of these messages is the WM_CLOSE message. Meaning, components talk to each other by sending each other little messages. Windows is a message-based operating system. Stay far away! Posting a WM_CLOSE message This is most likely the nastiest approach to trying to end an application. So if we just destroy that window, we'll still have the process stinking up the place :(Īnd that would be even harder to get rid off than the application would have been. So this would not be recommended! Destroying the main application windowĪs we just learned, the main application window is just part of the process. But this will kill the application so abruptly, that it will have no chance to save any critical data to disk. So this would be great to fully end an application. So, if the process is the root of an application, if you terminate it, everything else will go away as well. The window is what you will see on your desktop and what you will interact with. Inside that process, the application may create a window. In Windows, an application lives in a process. Now, let's look at all 3 ways in reverse order. Pressing Alt+ F4 will just send the WM_CLOSE message to the application window. This is the same thing that Alt+ F4 works. The way you're intended to close an application. Destroying the main application window.Posting a WM_CLOSE window message to the main application window.OK, to my understanding, there are several ways a Windows application can be terminated. As that is quite the brute force method to exit a process. But this would most likely make you lose a lot of work. You could only possibly create a custom solution with AutoHotKey (or similar tools) that kills the process. This problem would persist with any other hotkey as well. The only reason it doesn't work as advertised is ignorant programmers who refuse to follow Microsoft design guidelines. This is the key combination to end a program.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |