devxlogo

Instant About Boxes

Instant About Boxes

The ShellAbout API call provides a quick and easy way to show an aboutbox (using the standard Win95 format) without having to include an additionalform in your project. The call uses four parameters: the hWnd of your maindialog, a string containing the name of your application, another stringcontaining an optional additional line of text, and a long pointer to thehandle of an icon. Start by placing this code in a BAS module:

 Global Const GWW_HINSTANCE = (-6)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 LongDeclare Function ExtractIcon Lib "shell32.dll" _ 	Alias "ExtractIconA" (ByVal hInst As Long, _	ByVal lpszExeFileName As String, ByVal _	nIconIndex As Long) As LongDeclare Function GetWindowLong Lib "user32" _	Alias "GetWindowLongA" (ByVal hwnd As Long, _	ByVal nIndex As Long) As Long

Add this routine to a button or menu to call your about box:

 	Dim lRet As Long	Dim lNull As Long	Dim lIcon As Long	Dim lInst As Long	lInst = GetWindowLong_		(Form1.hwnd, GWW_HINSTANCE)	lIcon = ExtractIcon(lInst, "MYEXE.EXE", 0&) 	lRet = ShellAbout(Form1.hwnd, _		"My App Name", "Copyright © 1995 _		My Company Name" & Chr(13) & _		Chr$(10) & "Serial # xxxxxxxxx-xxx", lIcon)

lRet will return true if the dialog was able to display and false ifthere was a problem. All of the required functions operate in both Windows95 and Windows NT.

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist