Copyright: VBSTR (c)1993 by Mark Gamber


VBSTR Contents

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

About VBSTR.DLL

Disclaimer

VBSTR Functions:

VBEnumChildWindows

VBEnumTaskWindows

VBEnumWindows

VBFullPath

VBGetClassName

VBGetClipboardText

VBGetDiskDriveType

VBGetDOSEnvironment

VBGetFreeDiskSpace

VBGetMenuString

VBGetModuleFilename

VBGetProfileString

VBGetPrivateProfileString

VBGetSystemDirectory

VBGetTotalDiskSpace

VBGetWindowsDirectory

VBGetWindowText

VBMakePath


About VBSTR.DLL

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

About VBSTR:

VBSTR is a Visual Basic utility DLL designed to make the Windows API a little friendlier by providing translation functions from API string types to Visual Basic string types. In addition, disk utilities are provided to retrieve the type of disk drive and the number of bytes available and free on a given disk. Window enumeration functions are also provided as callbacks are not directly available from Visual Basic. Listed below are the functions available to a Visual Basic programmer from using this DLL.

The author may be reached on the following service:

America Online: Email to PCA MarkG


VBSTR Disclaimer

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Disclaimer:

In using the software VBSTR, the user agrees to indemnify the author and software from damages incurred through misuse or otherwise. No guarentees are implied.  If the user is unable to comply, the software should be destroyed immediately.

VBSTR is freely distributable but not public domain and may not be altered in any way without explicit permission from the author. The author may be reached at the following:

America Online:  Email to PCA MarkG


VBGetWindowText

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetWindowText$ lib "vbstr.dll" ( ByVal win% )

Remarks:

Retrieves the title text from a window specified by the handle passed through win%.

Example:

t$ = VBGetWindowText( Form1.hWnd )

See Also:  VBGetClassName, VBEnumWindows, VBEnumChildWindows


VBGetClassName

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetClassName$ lib "vbstr.dll" ( ByVal win% )

Remarks:

Retrieves the class name of a specified window passed through win%.

Example:

t$ = VBGetClassName( Form1.hWnd )

See Also: VBGetWindowText


VBGetWindowsDirectory

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetWindowsDirectory$ lib "vbstr.dll" ()

Remarks:

Retrieves the "home" directory of the Windows system currently running. Commonly, this is

"DRIVE:\WINDOWS".

Example:

t$ = VBGetWindowsDirectory()

See Also: VBGetSystemDirectory


VBGetSystemDirectory

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetSystemDirectory$ lib "vbstr.dll" ()

Remarks:

Retrieves the "home" directory of the currently running Window's System files. Commonly,

this is "DRIVE:\WINDOWS\SYSTEM".

Example:

t$ = VBGetSystemDirectory()

See Also: VBGetWindowsDirectory


VBGetProfileString

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetProfileString$ lib "vbstr.dll" ( ByVal Section$, ByVal Entry$ )

Remarks:

Retrieves a text string associated with an Entry within a Section of the WIN.INI file.

Example:

t$ = VBGetProfileString( "Windows", "Programs" )

See Also: VBGetPrivateProfileString


VBGetPrivateProfileString

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetPrivateProfileString$ lib "vbstr.dll" ( ByVal Section$, 	ByVal Entry$, ByVal Filename$ )

Remarks:

Retrieves a text string associated with an Entry within a Section of a specified INI file,

such as PROGMAN.INI

Example:

t$ = VBGetPrivateProfileString( "Settings", "Order", "PROGMAN.INI" )

See Also: VBGetProfileString


VBGetModuleFileName

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetModuleFileName$ lib "vbstr.dll" ( ByVal hModHandle% )

Remarks:

Retrieves the filename associated with a running task.

Example:

t$ = VBGetModuleFileName( GetModuleHandle( "USER" ) )


VBGetClipboardText

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetClipboardText$ lib "vbstr.dll" ( ByVal hFormWin% )

Remarks:

Retrieves any text present in the Windows Clipboard. If none is available, an empty string

with a length of ZERO is returned.

Examples:

t$ = VBGetClipboardText( Form1.hWnd )


VBGetFreeDiskSpace

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetFreeDiskSpace& lib "vbstr.dll" ( ByVal drive% )

Remarks:

Returns a LONG integer value of the number of free bytes on a specified disk. Drives are

specified as 0=default, 1=A:, 2=B: and so on. If an error occurs, a value of -1 is returned since 0 is a valid number if the disk is empty.

Example:

sp& = VBGetFreeDiskSpace( 3 )

See Also: VBGetTotalDiskSpace, VBGetDiskDriveType


VBGetTotalDiskSpace

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetTotalDiskSpace& lib "vbstr.dll" ( ByVal drive% )

Remarks:

Returns the total number of bytes on a disk including free and used bytes. If an error

occurs, -1 is returned since 0 is a valid size.

Example:

d& = VBGetTotalDiskSpace( 3 )

See Also: VBGetFreeDiskSpace, VBGetDiskDriveType


VBMakePath

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBMakePath$ Lib "vbstr.dll" ( ByVal lpDrive$, ByVal lpDir$, ByVal lpFname$, ByVal lpExt$ )

Remarks:

Constructs a complete pathname from the parts passed to the function. If any part is a

NULL value or an empty string, it is ignored.

Example:

t$ = VBMakePath( "C", "\WINDOWS", "WIN", "COM" )

See Also: VBFullPath


VBFullPath

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBFullPath$ Lib "vbstr.dll" ( ByVal PathPath$ )

Remarks:

Takes a partial file pathname and constructs a complete name, if possible. If an error

occurs, an empty (zero length) string is returned.

Example:

t$ = VBFullPath( "win.com" )

See Also: VBMakePath


VBGetDiskDriveType

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetDiskDriveType% Lib "vbstr.dll" ( ByVal DriveNum% )

Remarks:

Returns the type of drive being queried. Possible return values are: 1 = 360K, 2 = 1.2M, 3 = 720K, 4 = 1.44M Any other number is undefined.

Example:

type% = VBGetDiskDriveType( 0 )

See Also: VBGetFreeDiskSpace, VBGetTotalDiskSpace


VBEnumWindows

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBEnumWindows% Lib "vbdll.dll" ( ByVal iNum% )

Remarks:

If iNum% is -1, the total number of windows available is returned from the this function. If

iNum% refers to a valid window according to the window count (-1), then a window handle is

returned as found in the window enumeration.

Example:

count% = VBEnumWindows( -1 )

for i% = 1 to count%

t$ = VBGetWindowText( VBEnumWindows( i% ) )

next i%

See Also: VBEnumChildWindows, VBEnumTaskWindows


VBEnumChildWindows

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBEnumChildWindows% Lib "vbdll.dll" ( ByVal win%, ByVal iNum% )

Remarks:

If iNum% is -1, the number of child windows available from the parent specified in the win% parameter is returned. If iNum% refers to a valid window according to the window count (-1), then a window handle is returned.

Example:

win% = FindWindow( "PROGMAN", 0 )

if win% <> 0 then

count% = VBEnumChildWindows( win%, -1 )

if count% > 0 then

for i% = 1 to count%

newwin% = VBEnumChildWindows( win%, i% )

next i%

endif

endif

See Also: VBEnumWindows, VBEnumTaskWindows


VBEnumTaskWindows

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBEnumTaskWindows% Lib "vbdll.dll" ( ByVal hTask%, ByVal iNum% )

Remarks:

If iNum% is -1, the number of windows owned by the specified task passed as hTask% is returned. If iNum% refers to a valid window according to the window count (-1), then a window handle is returned.

Example:

hTask% = GetCurrentTask()

if hTask% <> 0 then

count% = VBEnumTaskWindows( hTask%, -1 )

if count% > 0 then

for i% = 1 to count%

newtask% = VBEnumTaskWindows( hTask%, i% )

next i%

endif

endif

See Also: VBEnumWindows, VBEnumChildWindows


VBGetDOSEnvironment

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetDOSEnvironment$ Lib "vbdll.dll" ()

Remarks:

Returns the current DOS environment string, such as COMSPEC=C:\COMMAND.COM

Example:

t$ = VBGetDOSEnvironment()


VBGetMenuString

VBSTR: Visual Basic Aid and Information DLL

Version 0.02

(C)1993 by Mark Gamber. May be Freely Distributed.

Declare Function VBGetMenuString$ Lib "vbdll.dll" ( ByVal hMenu%, ByVal iNum%, ByVal iFlag%  )

Remarks:

Returns a string associated with a menu item, the menu specified by the hMenu% variable and iNum representing either a menu offset or a menu item ID number, depending on the setting of iFlag%. If iFlag% is 0, iNum% is an ID number and if iFlag% is 1024, iNum% is an offset.

Example:

win% = FindWindow( "PROGMAN", 0 )

if win% <> 0 then

hMenu% = GetMenu( win% )

if hMenu% <> 0 then

t$ = VBGetMenuString( hMenu%, 1, 1024 )

endif

endif

See Also: VBEnumWindows, VBEnumChildWindows