HOWTO: Kill an Application with System Menu Using VB5Last reviewed: October 16, 1997Article ID: Q168204 |
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 INFORMATIONThis sample program uses the Windows API SendMessage function to post a message to any window in the environment, provided the handle to the window is known. The API FindWindow function is used to determine the handle associated with the window the user wants to close. To use FindWindow, you must know either the ClassName or the Caption (if any) of that window. Please see the REFERENCES section below for more information.
Steps to Create Example Program
REFERENCESFor more information on the FindWindow and SendMessage functions, query on the following words in the Microsoft Knowledge Base:
FindWindow and Visual Basic or SendMessage and Visual BasicFor information on a different sample application that returns assorted information for a windowed application, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q112649 TITLE : How to Get a Window's Class Name and Other Window Attributes Keywords : APrgOther vb5all vb5howto kbcode kbusage kbhowto Version : 5.0 Platform : NT WINDOWS Issue type : kbhowto |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |