How to Use ShellAbout() to Display Standard Windows About Box

Last reviewed: June 21, 1995
Article ID: Q122893
The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0

SUMMARY

This article shows you how to implement the Windows API ShellAbout() function to display the standard Windows About box that you see in the Program Manager, NotePad, and the other Microsoft Windows accessories.

MORE INFORMATION

ShellAbout() resides in SHELL.DLL. Use the following Declare statement in Visual Basic to declare it; enter the entire Declare statement as one, single line:

   Declare Sub ShellAbout Lib "shell.dll" (ByVal hWndOwner As Integer,
      ByVal lpszAppName As String, By lpszMoreInfo As String,
      ByVal hIcon As Integer)

where:

      hWndOwner    - the Window handle of the parent form.
      lpszAppName  - the information you want to appear in the caption
                     of the About box, usually the application's title.
      lpszMoreInfo - any additional message you want to display.
      hIcon        - the handle to the icon you want displayed in the upper
                     left corner.

Step-by-Step Example

The following steps show you how to call the ShellAbout() API.

  1. Start a new project in Visual Basic (Alt, F, N). Form1 is created by default.

  2. Place a command button (Command1) on Form1.

  3. Add the following declaration to the general declarations section of Form1:

       ' Enter the following three lines as one, single line:
       Declare Sub ShellAbout Lib "shell.dll" (ByVal hWndOwner As Integer,
          ByVal lpszAppName As String, ByVal lpszMoreInfo As String,
          ByVal hIcon As Integer)
    
    

  4. Add the following code to the Command1_Click event procedure:

       Sub Command1_Click()
          Call ShellAbout(Me.hWnd, app.Title, "My More Info Section", Me.Icon)
       End Sub
    
    

  5. Test the program by pressing the F5 key to run it. Click the command button to display the About box.


Additional reference words: 2.00 3.00
KBCategory: kbprg
KBSubcategory: APrgOther


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 21, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.