How to Kill an Application with System Menu Using Visual BasicLast reviewed: January 22, 1996Article ID: Q142817 |
The information in this article applies to:
SUMMARYMicrosoft Visual Basic for Windows can use the Microsoft Windows API SendMessage function to close any active window that has a system menu (referred to as the Control Box within Visual Basic for Windows) with the Close option.
MORE INFORMATIONYou can use the Windows API SendMessage function to post a message to any window in the environment as long as the handle to the window is known. You can use the API FindWindow function to determine the handle associated with the window the user wants to close. Query on the following words in the Microsoft Knowledge Base for more information on the FindWindow function:
FindWindow and Visual BasicTo create a program to close an occurrence of the Microsoft Windows version 3.0 Calculator program, do the following:
|
Additional reference words: 1.00 2.00 3.00 4.00 vb4win vb416
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |