THE USABLE I NTERFACE
JUNE, 1996
Note: The code used in this article is available in the Toolbox's CodeVault. The file UI-0696.ZIP is a Visual Basic 4.0 (32-bit) project that contains a sample application that fully demonstrates the techniques in this article.
About dialog boxes come in all shapes and sizes. Some are extremely simple, with just a small copyright message, while others are very perplexing, just to look at. The Visual Basic about dialog is an example of poor design. While the copyright information and license information should go here, the legal mumbo-jumbo should not. It is best suited for the manual. Not only do we see this message on VB's splash screen, we must agree to it before we install the product. Developers are under enough stress anyway, they shouldn't be scared every time they turn around! :-).
One other thing -- why is there a system information button here? Who would possibly look here for something like that? Don't get me wrong, the Windows 95 version of the utility is great, but it would look more professional, and practical, if it was located under VB's 'Tools' menu.
I'm not just picking on VB, many applications use these hefty dialogs. Still, others use nicely designed about dialogs. Microsoft's 'common about dialog' is a good example of what I mean. It elegantly displays the product name and icon, licensing information, and system statues.
If you want an about dialog, like those found in the Microsoft applets, you can summon up the power of the Windows API, but beware of it's side effects.
Declare Function ShellAbout Lib "shell32.dll" _Alias "ShellAboutA" (ByVal hwnd As Long, ByVal szApp As String, _ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
To make the about dialog appear, use this statement:
Call ShellAbout(Me.hwnd, "Cool App", "Copyright 1996 Cool Co.", Me.Icon)
Although this lets you have an about dialog, without having to add another form to your project, look at what this does. For example, say you have an application called 'Cool App', it would read as 'Microsoft Cool App', on the dialog. That makes it look like a Microsoft product (which, by-the-way, Microsoft doesn't like). It also sticks the MS copyright above yours. This behavior was not prominent under Windows 3.x.
While slapping a quick about dialog to your project is easy, it should be taken with extreme care. It provides the user the 'third impression' of your product. How many times, after starting a new application, do you instantly click on the 'About ...' menu item? Don't shock them with something that will be burnt into their retina. Instead, give them something pleasing to the eye. This is where my template comes into play.
Here is what I classify as a good about dialog. It provides a line for the name and version of the product, copyright information, total free memory, and an icon. Also note the line under the product name. You can use this line to display the version of Windows for which your product was geared for. This line could also be used for version information. If you want to display additional copyright information, or license, simply use the text box in the center. All you have to do is fill in the blanks!
You shouldn't have to modify the 'OK' button. It contains a simple 'Unload Me' statement. The same goes for the memory status indicator. But, how is that done? I'll tell you:
First, we need to call upon GlobalMemoryStatus, and it's related Type.
Type MEMORYSTATUS dwLength As Long dwMemoryLoad As Long dwTotalPhys As Long dwAvailPhys As Long dwTotalPageFile As Long dwAvailPageFile As Long dwTotalVirtual As Long dwAvailVirtual As Long End Type Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)Now that we are ready, we can call the following in the Form_Load event of the dialog.
Dim memsts As MEMORYSTATUS Dim memory As Long GlobalMemoryStatus memsts memory& = memsts.dwTotalPhys lblTotalMem.Caption = Format$(memory& \ 1024, "###,###,###") + "K"This code retrieves the total memory from GlobalMemoryStatus, then formats to make it look good.
Since most users expect an about dialog, give them one. Not only does it provide the user with important information, it allows you to give yourself a good 'pat on the back', after your application's completion. Keeping the dialog from getting repulsive, however, can be a tricky process. Using the provided template should be a quick and easy alternative to this tricky process.
[About Ryan Heldt: In addition to writing The Usable Interface, Ryan also maintains The Toolbox Visual Basic Home Page. He is currently working on Supreme Video Poker, . Ryan can be reached at rheldt@vb-online.com]
Click here to go back to the June '96 Article Index