Help Contents
Statbar VBX Help Contents

Version 2.1.1

Overview

Statbar VBX Properties and Events

Statbar Visual Basic API

Registering Statbar


What Is Statbar?

Statbar is a custom control to be used in Visual Basic applications.  Statbar is a useful control that sits on a Parent form and can act as an information provider to the user. Statbar looks and acts just like any other Windows Status Bar, so users will instantly know how to utilize it.

Statbar can display the current date and time, as well as the keystates of the NumLock key and  CapsLock key. Statbar also provides ample room for custom messages and information panels that you can use to display any information to the user.

*****New Features!!!******

Statbar can also subclass the menu on the Window it sits on to trap when the user is selecting a menu option. Statbar will fire its MenuSelect event when the user is skimming the menus. This gives you an opportunity to provide the user with hints on what menu options do, just like the major Windows applications do.

In addition, Statbar provides functions via an API that allow a Visual Basic programmer to easily use functionality previously provided only in C programs. Now you can do these things easily using Statbar!


Why Would I Use Statbar?

Statbar extends Visual Basic allowing you to have a common look and feel like other Windows apps, as well as providing useful information to the user of your applciation. Statbar encapsulates a lot of functionality that would be difficult to duplicate (not to mention time consuming) to reproduce in Visual Basic.


Registering Statbar

THANKS TO JIM TYMINSKI FOR HELPING WITH THE API FUNCTIONS AND THIS FILE

                  REGISTRATION INFORMATION

    (for ShareWare/Registered Version)

Statbar VBX is not, and has never been, public domain

software, nor is it free software.

The Shareware version of Statbar VBX can NOT be distributed with compiled applications. It will refuse to load if the user is not in the Visual Basic Design Environment. To obtain the fully distributable version of Statbar VBX REGISTER NOW!!

TO REGISTER:

The easiest way to Register Statbar is through CompuServes SWREG forum. GO SWREG and Choose Register Shareware. Statbar VBXs SWREG ID # is : 3947.  As soon as we receive notification of your registration (usually 1 - 3 days) we will send you out via e-Mail the latest version and documentation. You also qualify to receive the next version free of charge.

Or, by Snail Mail:

Send a check or money order payable to

Ric Perrott for $10 + $2 S&H to:

WingedAxe Software, Inc.

829 Ninth Avenue, Suite 3C

New York, NY  10019

Place "Statbar VBX" in the Memo portion of the check.

Please state disk size preference 3.5" or 5.25"

You will receive a disk with the latest version, a free upgrade to the next version, and a support number.

Also, Registered Users receive a special e-mail ID where they can write and request changes or additions to the Control.

We can also be reached via Compuserve:

Compuserve ID: 73764,3540

Or America Online:

AOL: PCC RicP

Internet: pccricp@aol.com

Statbar VBX License Agreement

======================================================

Your use of Statbar VBX indicates your acceptance of the following

terms and conditions:

Statbar VBX ("the Software") is a Visual Basic custom control

licensed by WingedAxe Software, Inc. ("WAS").

Shareware license:

You are free to distribute the entire unmodified contents of the distribution package to anyone you wish. You may NOT distribute any other programs that utilizes the Software without obtaining a Registered User License for the Software from WAS. For a period of no more than 21 days, you may use, test and duplicate the enclosed version of the Software.  Thereafter if you wish to continue using the Software you must register the Software with WAS, or else you must cease all use of the Software.  You will be an infringer if you do not pay the registration fee and continue to use this version of the Software for more than 21 days.

Registered User License:

If you pay the registration fee for the Software to WAS, WAS will grant a

non-exclusive license for one natural person to use one copy of the software regardless if the owner of the license is a person or a business

("the Licensee"). In addition the Licensee may distribute the Statbar VBX

Visual Basic Custom Control ("the VBX") with any or all products that use the VBX with the exceptions that (a) the recipients of any such

program ("the Recipients") are not licensed to use the VBX or the Software except with the products produced by Licensees, and (b) the Recipients may not further redistribute the VBX, and (c) the product using the VBX cannot enable the user to produce other programs using the VBX or other parts of the supplied distribution package, and (d) the product using the VBX must contain a notice stating WASs copyright of the VBX. No purported transfer of the license shall be effective until the licensee notifies WAS of the name and address of the person receiving the license ("the Transferee"), and transfers all copies of the Software to the Transferee, and removes or destroys any other copies of the Software in the possession of, or under the control of the Licensee.

Limited Warranty:

The Software is distributed and licensed under an "as is" basis. For a period of 90 days from the date that you pay the registration fee, you may return all materials provided by WAS, destroy any copies you have made and then you will receive a refund of your registration fee minus a $3 restocking charge, provided that the returned materials are undamaged.  If the materials are damaged your refund will be deducted for the replacement costs of the damaged materials.

Disclaimer of Warranties:

WAS makes no claims as to the suitability of the software for any specific purpose. EXCEPT FOR THE LIMITED WARRANTY STATED ABOVE, WAS DISCLAIMS ANY AND ALL OTHER WARRANTIES EXPRESS OR IMPLIED, WRITTEN OR ORAL, INCLUDING ANY

WARRANTIES OF MERCHANT ABILITY OR FITNESS FOR ANY SPECIFIC PURPOSE. The Limited Warranty stated above gives you specific legal rights, but you may have other rights which may vary from state to state.

Limitation of Liability:

In no event shall WAS be liable for any damages whatsoever arising out of the use of the Software, including without limitation any direct, indirect

or consequential damages or any damages for business interruption, loss of profits, loss of information, or any pecuniary  loss even if WAS has been notified of the possibility of such damages. The limitation or exclusion of liability for incidental or consequential damages may not be allowed in some states, and in these states those particular prohibited limitations do not apply.

Limitation of Remedies:

Should you have problems with the Software, WASs entire liability and your exclusive remedy shall be, at WASs discretion, either (a) to repair or replace the Software, or (b) to terminate the License and send you a refund of your registration fee minus a restocking charge, provided that all materials are returned undamaged. If the materials are damaged your refund will be deducted for the replacement costs of the damaged materials.

Copyright Information

The Software is protected by the copyright laws of the United States, and by the copyright laws of many other countries pursuant to international treaties. The VBX and all other materials provided in the distribution package are Copyright (c)1994 WingedAxe Software, Inc.  All Rights reserved. No portion of the Software, documentation or examples may be copied, stored, or transmitted except as provided by the license.

Other brand and product names are trademarks or registered trademarks of their respective holders.


Statbar Custom Control Reference
Statbar VBX Reference

Description	The Statbar Custom Control allows you to provide information in  a standard and easy way to your users. Also the API provides functionality not available in Visual Basic alone.
File Name	STATBAR.VBX
Class Name	Statbar
Related Topics:

Properties, Events, and Methods

Properties Reference

Events Reference


Properties, Events, and Methods

All of the properties, events, and methods for Statbar are listed in the tables below.  All standard Visual Basic properties, events, and methods are denoted with an asterisk(*) and can be found documented in the Visual Basic Language Reference that comes with Visual Basic.

Properties

About	*Align	*DragIcon
*DragMode	*FontName, *Fontsize	*FontBold, Italic etc.
*Index	*hWnd	*MousePointer
*Name	*Parent	*Tag
*Visible	CapsText	CapsVisible
CaptureMenu	DateVisible	DisplaySeconds
ExtraText	ExtraTextVisible	ExtraTextWidth
InsertStatus	InsertText	InsertVisible
NumText	NumVisible	OfflineText
OnlineStatus	OnlineText	OnlineVisible
OverStrikeText	TimeVisible	Text
TextVisible
Events

*Click	*DblClick	*DragDrop
*DragOver	*MouseDown	*MouseMove
*MouseUp	*LinkClose	*LinkError
*LinkNotify	*LinkOpen	MenuSelect
Methods

Statbar supports the following standard methods:

Zorder, Drag, LinkSend, Refresh


Properties Reference

The following is a detailed reference of all the custom properties supported by Statbar.

Related Topics:

About Property

CaptureMenu Property

CapsText Property

CapsVisible Property

DateVisible Property

DisplaySeconds Property

ExtraText Property

ExtraTextVisible Property

ExtraTextWidth Property

InsertStatus Property

InsertText Property

InsertVisible Property

Numtext Property

NumVisible Property

OfflineText Property

OnlineStatus Property

OnlineText Property

OnlineVisible

Text Property


About Property

Description	Displays version information about the Statbar Custom Control.
Usage	Double click on the ellipses ('...') button next to the property text to activate the about dialog box.
Remarks	Available only at design time.
Data Type	N/A


CapsText Property

Description	Determines the Text String that will be displayed in the CapsText Panel.
Usage	[form.]Statbar.CapsText = [String$]
Remarks	Example: Statbar.CapsText = CAPS ON Available at runtime /design and is read/write.
Data Type	String


CapsVisible  Property

Description	Determines if the CapsText Panel will be visible at run time..
Usage	[form.]Statbar.CapsVisible = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


DateVisible  Property

Description	Determines if the Date Panel should be visible at run time.
Usage	[form.]Statbar.DateVisible = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


DisplaySeconds  Property

Description	Determines if the Time Panel should display a seconds counter
Usage	[form.]Statbar.DisplaySeconds = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


ExtraText Property

Description	This Property Sets the text string for the ExtraText panel
Usage	[form.]Statbar.ExtraText[ = value$]
Remarks	Usually used to display a short bit of info to the user without changing the primary Text in the bars main panel. Example: ' Set text then make panel visible Message$ = "Must Select Line"  Statbar1.ExtraTextWidth = 400 'Depends on ScaleMode 'Twips or Pixels..etc.. Statbar1.ExtraText = Message$  Statbar1.ExtraTextVisible = True Available at runtime /design and is read/write.
Data Type	String


ExtraTextVisible Property

Description	This property determines the visibilty of the ExtraText Panel.
Usage	[form.]Statbar.ExtraTextVisible = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


ExtraTextWidth Property

Description	Sets the width of the ExtraText panel
Usage	[form.]Statbar.ExtraTextWidth = value%
Remarks	Example: ' Set text then make panel visible Message$ = "Must Select Line"  Statbar1.ExtraTextWidth = 1500 'In Twips Statbar1.ExtraText = Message$  Statbar1.ExtraTextVisible = True Available at runtime /design and is read/write.
Data Type	Integer


CaptureMenu Property

Description	Determines when Statbar will Capture the Menu Captions to use to generate MenuSelect events..
Usage	[form.]Statbar.CaptureMenu = True/False
Remarks	Should be set to True to begin Capturing Menu Caption and firing MenuSelect events, and False to stop firing the MenuSelect event. Example: Statbar.CaptureMenu = True 'Statbar is now ready to trap the menu select 'and fire the MenuSelect event. Available only at runtime.
Data Type	Bool


InsertStatus Property

Description	Determines if the InsertStatus panel should display the text for Insert or Overstrike mode.
Usage	[form.]Statbar.InsertStatus = True/False
Remarks	Set to True for Insert and False for Overstrike. Available at runtime /design and is read/write
Data Type	Bool


InsertText Property

Description	Determines the Text to display if the InsertStatus Property is set to True and it is visible.
Usage	[form.]Statbar.InsertText = Text$
Remarks	Example: X$ = "INSERT" Statbar1.InsertText = X$ Available at runtime /design and is read/write.
Data Type	String


InsertVisisble Property
InsertVisible  Property

Description	Determines if the Insert Panel is visible at run time.
Usage	[form.]Statbar.InsertVisible = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


Numtext  Property

Description	Determines the Text to display if the NumVisible Property is set to True.
Usage	[form.]Statbar.NumText = Text$
Remarks	Example: X$ = "NUMLOCK" Statbar1.NumText = X$ Available at runtime /design and is read/write.
Data Type	String


NumVisible Property

Description	Determines if the NumLock Panel is visible at run time.
Usage	[form.]Statbar.NumVisible = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


Offline/Online Properties
Offline/Online Text Properties

Description	Determines the Text to display if the Online/Offline Panel is set to Visible.
Usage	[form.]Statbar.OnlineText = Text$ [form.]Statbar.OfflineText = Text$
Remarks	Example: X$ = "ONLINE" Statbar1.OnlineText = X$ Available at runtime /design and is read/write.
Data Type	String


OnlineStatus Property

Description	Determines if the OnlineStatus panel should display the text for Online or Offline mode.
Usage	[form.]Statbar.OnlineStatus = True/False
Remarks	Set to True for Online and False for Offline. Available at runtime /design and is read/write
Data Type	Bool


OnlineVisible Property

Description	Determines if the Online Panel is visible at run time.
Usage	[form.]Statbar.OnlineVisible = True/False
Remarks	Available at runtime /design and is read/write
Data Type	Bool


Text Property

Description	This is the default property for the statbar, and determines what text message displays in the Status Bars main panel.
Usage	[form.]Statbar.Text = value$ OR [form.]Statbar = value$
Remarks	This property is used to set the primary Message in the main panel Example: Statbar.Text = "Click Here To Open File." Available at runtime /design and is read/write.
Data Type	String


Events Reference

The following is a detailed reference of all the custom events supported by Statbar.

Related Topics:

MenuSelect Event


MenuSelect Event

Description	Statbar fires this event each time one of the choices in a menu is selected with the mouse or keyboard.
Syntax	Sub Statbar_MenuSelect (Caption As String)
Remarks	When a menu option is selected, Statbar fires this event, passing the Caption text of the menu option selected. Parameter Description Caption Identifies the text of the menu option selected.


Statbar API
Statbar Visual Basic API

Overview

API Reference


- Statbar API - Overview
Overview

Statbar comes with a set of API functions that can assist you in calling Windows API functions, or just emulating the Macros that C programmers have had all along.

Several Windows messages require the programmer to be able to access data via pointers.  Although in languages like C it is possible to provide pointers, it is not possible using Visual Basic.  These API functions allow you to access data while "faking" pointers.  Statbar uses long integers to represent the pointers.  Since pointers are actually just 32-bit numbers (i.e., long integers), you can actually "fake" Windows by sending certain Windows API functions the long integer equivalent of a pointer as supplied by the Statbar API.

CAUTION: These routines require the use of pointers.  Take care when using such routines as they may cause unpredictable results if used improperly.  Do not pass invalid addresses to these routines.  Doing so may cause a GPF or potential loss of data.

Special Note: You may notice that the Lib in the Declare statements below refer STATBAR.VBX.  Why is this not referencing a DLL?  Since a custom control (VBX) is really a DLL (with special routines in it so that Visual Basic can access it), functions can be called externally from them.  So rather than supplying a separate DLL that you would need to include with your distribution, Statbar comes with a full set of functions built right into itself.  All of the following functions can be called directly from the file STATBAR.VBX.

As with all DLLs and VBXs, the executable file must be either in the path, the current directory, or the Windows SYSTEM directory in order for Visual Basic to find and load them.  See the Chapter 22, "Calling Procedures in DLLs" in the Microsoft Visual Basic Programmer's Guide for a further description on calling external procedures.


API Reference

The following section details the API functions available within Statbar.

Related Topics:

ClickObject

TypeToAddress

IntFromAddress

LongFromAddress

StringFromAddress

TypeFromAddress

GetVarAddress

HiWord

LoWord

MakeLong

UShort2Long

Long2UShort

GetPhysicalRamTotal

GetDriveSpace


ClickObject

Description	This function allows you to fire a click event on any control from anywhere in your Visual Basic application.
Declaration	Declare Function ClickObject Lib "Statbar.VBX" (ByVal hWnd As Integer, ByVal hObject As Integer) As Long
Remarks	Sometimes it is necessary to fire a Click event on a control from another form or module. This function will allow you to fire a Click event on any type of Control that supports one. Juts pass the handle of the window thats calling the Click, and the hWnd of the Object to Click.. Parameter Description hWnd The handle of the Window calling the function. hObject  The handle of the Object to be clicked
Return Value	The function returns a long integer value representing the success of the function.


TypeToAddress

Description	This function copies the contents of a type variable to an area of memory.
Declaration	Declare Function TypeToAddress Lib "Statbar.VBX" (Address As Long, lpType As Any, Bytes As Integer) As Integer
Remarks	Since Visual Basic does not allow you to access memory directly, there is no way to change the contents of a structure passed as a pointer in a Windows API.  You can use this function to write the contents of a Type to an area of memory. Parameter Description Address A long integer representing the far address of the area of memory to write to. lpType The Type variable to write to memory. Bytes The length of the Type variable.  This can be determined using the Visual Basic Len function, i.e., cbBytes = Len(lpType). CAUTION: This routine requires the use of a pointer.  Do not pass an invalid address to this routine.  Doing so may cause a GPF or potential loss of data.


IntFromAddress

Description	Returns the 16-bit integer value from the data at the address specified.
Declaration	Declare Function IntFromAddress Lib "Statbar.VBX" (Address As Long) As Integer
Remarks	Parameter Description address The 32-bit far address of the integer.
Return Value	Returns the integer value associated with the address.


LongFromAddress

Description	Returns the 32-bit long integer value from the data at the address specified.
Declaration	Declare Function LongFromAddress Lib "Statbar.VBX" (Address As Long) As Long
Remarks	Parameter Description address The 32-bit far address of the long integer.
Return Value	Returns the long integer value associated with the address.


StringFromAddress

Description	Returns a string from the data at the address specified.
Declaration	Declare Function StringFromAddress Lib "Statbar.VBX" (Address As Long) As String
Remarks	The string located at the address specified must end with a terminating zero. Parameter Description address The 32-bit far address of the string.
Return Value	Returns the string associated with the address.


TypeFromAddress

Description	Returns a Type structure from the data at the address specified.
Declaration	Declare Function TypeFromAddress Lib "Statbar.VBX" (Address As Long, lpType As Any, Bytes As Integer) As Integer
Remarks	The data located at the address specified will be copied into the Type structure variable defined by the calling program.  Only the number of bytes specified will be copied.  Do not specify more bytes then are actually allocated.  Doing so may produce unpredictable results such as a GPF or loss of data. Parameter Description address The 32-bit far address of the data. lpType The user defined Type variable to copy the data into. Bytes The number of bytes to copy.


GetVarAddress

Description	Returns the address of a Visual Basic variable.
Declaration	Declare Function GetVarAddress Lib "Statbar.VBX" (Variable As Any) As Long
Remarks	This function returns a 32 bit address of any variable or Type.  Any type of variable can be used. Parameter Description variable The variable or Type to get the address of.
Return Value	This function returns a 32-bit address of the variable or Type.


HiWord

Description	This function parses out the high-order 16-bit word value of a 32-bit long integer.
Declaration	Declare Function HiWord Lib "STATBAR.VBX" (ByVal lParam As Long) As Integer
Remarks	This API provides the same functionality as the property HiWord.   Parameter Description lParam The 32-bit long integer value to parse.
Return Value	Returns a 16-bit integer representing the high-order of the 32-bit long value.


LoWord

Description	This function parses out the low-order 16-bit word value of a 32-bit long integer.
Declaration	Declare Function LoWord Lib "STATBAR.VBX" (ByVal lParam As Long) As Integer
Remarks	This API provides the same functionality as the property LoWord.   Parameter Description lParam The 32-bit long integer value to parse.
Return Value	Returns a 16-bit integer representing the low-order of the 32-bit long value.


MakeLong

Description	This functions creates an unsigned long integer for use as an lParam parameter in a message by concatenating two integer values, specified by the wLow and wHigh parameters.
Declaration	Declare Function MakeLong Lib "STATBAR.VBX" (ByVal LoWord As Integer, Byval HiWord As Integer) As Long
Remarks	Parameter Description LoWord Specifies the low-order word of the new long value.  HiWord Specifies the high-order word of the new long value. address The 32-bit far address of the data.
Return Value	The return value specifies a long-integer value.


UShort2Long;Long2UShort
USHort2Long & Long2UShort

Description	These functions convert a signed long integer value to an unsigned integer value. and Vice-Versa
Declaration	Declare Function UShort2Long Lib "Statbar.VBX" (ByVal Value As Integer) As Long
Remarks	The value that is returned can be sent to a Windows API function that requires a USHORT or an unsigned int parameter.  Upon inspection of the return value you may see that it is negative.  Visual Basic does not have a means to represent an unsigned value, it therefore appears negative.  When passed to function in a DLL, the number will be converted to unsigned. Parameter Description Value The UShort integer value to convert.
Return Value	The function returns an Long or Integer value.


GetPhysicalRamTotal

Description	Returns the total amount of Physical RAM on the system
Declaration	Declare Function GetPhysicalRamTotal Lib "Statbar.VBX" () As Long
Remarks	This routine returns the total amount of Installed RAM on the system, rather than the amount of Free RAM, which can be obtained by using the API call GetFreeSpace()).
Return Value	A long value containg the RAM total in KBytes.


GetDriveSpace

Description	Returns Total Disk Space or Free Disk Space for a given drive.
Declaration	Declare Function GetDriveSpace Lib "Statbar.VBX" (ByVal Drive As Integer, ByVal Total As Integer) As Long
Remarks	This function will return both the Total Size of a disk drive, and the amount of free drive space remaining on that drive.. Parameter Description Drive The number of the drive (i.e  A: = 1, B: = 2 etc.). Total If True this function will return Total Drive Size, otherwise it will return Free Drive Space..