Copyright: Documentation (C) 1994 Christian Feichtner


contents
                                                              ToolBox V1.1

A Microsoft Access ® Library to make your Applications more comfortable to use and easier to develope.

Access ® and Windows ® are registered Trademarks of Microsoft Corp.

Contents

 Overview What is Toolbox and what is it not.

 Important Notes on using the library Read this before using the library

 License Agreement How to recieve the full Version and register and about registration benefits

Functions

Function Name	Purpose
BWCCMsgBox()	Borland Message Box
Ctl3DEnd()	3D - Message Boxes Init
Ctl3DInit()	3D- Message Box Quit
FrmCenter()	Centers Form
GetFreeRes()	Determines Free Resources
GetWavInfo()	Determines Wave File Characteristics
InitProgMeter()	Initialises progress-meter
IsMenuChecked()	Determine wether menu-entry is checked
OpenFileDialog()	Display GetOpenFileName dialog
PlayWav()	Plays wave file
ReadINI()	Reads string from INI File
RemoveProgMeter()	Removes progress-meter
SaveFileDialog()	Display GetSaveFileName dialog
SetAccessTitle()	Sets Access main window caption
SetAccWin()	Set state of the Access Main Window
SetCloseMenuState()	Set state of forms close menu
SetFormCaptionStyle()	Display system-menu, Minimizer, Maximizer
SetFormWin()	Set state of form windows
SetMenuStates()	Change state of user menu
UpdtProgMeter()	Updates progress-meter
WriteINI()	Writes String to INI

Predifined constants

How Can I

Display a Borland Style message mox ?

Display a Message Box in 3D Lool ?

Center a Form ?

Display visual Progress of any action ?

Prevent the user from closing a form with the System Menu

Determine, wether a Menu Item is checked ?

Maintain INI Files ?

Hide/Minimize/Restore a form window ?

Hide/Minimize/Restore the Access window ?

Display a different title in the Access main window ?

Determine free resources ?

Prompt  the user for a filename ?

Play a Wav file (on opening a form) ?

Misc

Hall of Fame

History


Overview

What is TOOLBOX and what it is not.

TOOLBOX is an Access Library, which makes designing and using Access applications more easy. It contains several functions, which call API functions, to display e.g. the GetOpenFile or GetSaveFile Dialog, or to change the states of a user-defined menu (check, uncheck, gray and ungray). Also it provides some functions, which will prevent the user from doing something, like closing a form with the system menu. Also several modifications to the Access Main Window can be made, like changing the text in the titlebar, to place e.g. a username. Also the Access progress-meter can be used to display visual progress of any action. Creating 3D looking and Borland-style message boxes is also included.

Please note, that some functions require DLLs to be located among your path variable. Functions requireing DLLs are:

GetOpenFileDialog() (requires COMMDLG.DLL)

GetSaveFileDialog() (requires COMMDLG.DLL)

Ctl3DInit() (requires CTL3D.DLL)

Ctl3DEnd() (requires CTL3D.DLL)

PlayWav() (requires MMSYSTEM.DLL and Soundcard and Driver(s) proper installed)

GetWavInfo() (requires MMSYSTEM.DLL and Soundcard and Driver(s) proper installed)

BWCCMsgBox() (requires BWCC.DLL)

All other Functions are dircet API calls.

	Please take care, that always the proper variable types for the functions are given. The functions are mainly designed to work from Modules. However some functions can be be called from form properties or macros. If you experience problems giving the parameters, simply create a new function in a modul which calls  the function desired with the correct parameters.

See Also:

License Agreement


License Agreement

Private License

This license is suitable for you, if you want to use the library only at home with your own private Access applications. You may not distribute the library with any application you wrote, including, but not limited to Shareware, Freeware, Public Domain, ... .

25 US$ + 5 US $ shipping & handling

Distribution License

With this license you may distribute applications which are using the library. But there must be a note somewhere in the application and in the manual like This Application uses TOOLBOX V1.1 by Christian Feichtner.

50 US$ + 5 US$ shipping & handling

	YOU MAY NOT DISTRIBUTE THE SHAREWARE VERSION IN COMBINATION WITH ANY APPLICATION. THE SHAREWARE VERSION IS FOR EVALUATION PURPOSES ONLY ! YOU ALSO  MAY NOT DISTRIBUTE ANY DOCUMENTATION OF NEITHER THE SHAREWARE VERSION NOR THE FULL REGISTERED VERSION WITH OR WITHOUT YOUR APPLICATIONS:

If you like this library, please fell free to distribute the Shareware package with all files to your friends.

Send bugs-reports and/or ideas to:

Christian Feichtner

Colerusstrasse 22

A-4040 Linz

Austria

Europe

Internet E-Mail:

K39222i at alijku11.edvz.uni-linz.ac.at

k39222i at cxmeta.edvz.uni-linz.ac.at

k3018e6 at wildsau.idv.uni-linz.ac.at

People who send in good and usefule ideas, will find their name in the hall of fame ...

Suggestions, comments or bug reports may be sent in via E-Mail. Registration is avaliable through written mail only.

	I will not answer any questions like How did you ...” on the library and any How do I ...” questions about Access. Please refer to your local Microsoft product support.

Registration Benefits

Order Form


CTL3DEND()

Purpose:

Unregisteres from the CTL3D.DLL and stops displaying your message boxes in 3D-look.

Should be called before your Access application terminates.

Function Call:

ReturnValue=Ctl3dEnd()

Parameters:

None

Returns:

Integer;

1	Function has terminated correctly
DLLERROR_	if a problem loading or using the DLL has occured
CTL3DNOINIT_	if CTL3DInit() has not been called before

Any other Value means, that an error has occured.

 This function requires CTL3D.DLL among your path variable. Be vey careful using the CTL3D.DLL. Be sure to always call CTL3DEnd(). As it seems that calling CTL3DEnd(), before you have called CTL3DInit() causes a stack vault, I have prevented this. You can't call CTL3DEnd() when you didn't call CTL3DInit() before.

Refrence:

Ctl3dInit()


CTL3DINIT()

Purpose:

Registers Access subclass Windows (message-boxes and file-dialog) for 3D-look.

Function Call:

ReturnValue=Ctl3dInit()

Parameters:

None

Returns:

Integer;

0	Function has terminated correctly
-1	error occured
DLLERROR_	If an error occured loading or using the DLL
CTL3DINITDONE_	If the initialization has already been made.

 0 if everything was ok, -1 if an error has occured. is returned.

	This function requires CTL3D.DLL among your path variable. Be always sure to call CTL3DEnd() if you dont want the 3-D look anymore. As it seems that calling CTL3DInit() twice (without calling CTL3DEnd()) produces a stack vault, I have prevented doing this. When you have called CTL3DInit() you must call CTL3DEnd() first, before you can call CTL3DInit() again.

Reference:

Ctl3dEnd()


Form Center
FRMCENTER()

Purpose:

Centers the form relatively to the Access Window.

Function Call:

ReturnValue=FrmCenter(Form)

Parameters:

Form; Form Object : Form that should be centered.

Returns:

Integer; Not needed

	This function should be called from the OnOpen property of an form. Please be sure that the Access Window is bigger than the form to center. Otherwise the form is going to be displayed somewhere unpredictable on your screen.

Example:

When opening a form in design view, look for the OnOpen property for your form.

(Don't forget the equal sign. It tells Access that this is a function, not a macro !

OnOpen: =FrmCenter(Forms![TestForm])


GETFREERES()

Purpose:

Determins the free System, User and GDI Resources

Function Call:

RetVal=GetFreeRes(Mode)

Parameters:

Mode: Integer: If called from a module, mode can be one of the predefined constants:

GFSR_SYSTEMRESOURCES_	Gets the free system resources
GFSR_USERRESOURCES_	Gets the free user resources
GFSR_GDIRESOURCES_	Gets the free GDI resources

Returns:

Integer; Percentage of the free Resources

Reference:

Predefined Constants


GETWAVINFO()

Purpose:

Determine wave file characteristics such as sample rate, frequency, length and mode (stereo or mono).

Function Call:

RetVal=GetWavInfo(wavefile,Rate,Mode,frequency,len)

Parameters:

wavefile: String: full path and file name of the wave file.

Returns:

Integer; <>0, if an error has occured, DLLERROR_ if a DLL error occured or 0 and the following Information:

Rate:	String:	Sampling rate (either 8 or 16 bit)
Mode:	String:	1 for mono, 2 for stereo
Frequency:	String:	Frequency in hertz (e.g. 22050 or 44100)
Len:	String:	Duration of the wave sound in milliseconds

 This function requires MMSYSTEM.DLL to reside among your path variable.

Example:

Ret=GetWavInfo("C:\WINDOWS\CHIMES.WAV",R$,M$,F$,L$)

If the function returns 0, the variables R$, M$, F$, L$ contain the information wanted; if the function returns any other value, the variables can return the valid information (depends where the error occured).

Reference:

PlayWav()


INITPROGMETER()

Purpose:

Initialises the progress-meter (displayed in the statusbar) with a given value

Function Call:

RetVal=InitProgMeter(Text,MaxValue)

Parameters:

Text:	String:	Text to be displayed left of the progress mater
MaxValue:	Long:	100 % of the value

Returns:

Integer; not needed

 Be sure that the status bar is set visible in the options menu.

Example:

If you know, that you have to work through e.g. 150 database entries (e.g. names), you would initialise the progress-meter with the value 150.

Reference:

UpdProgMeter()

RemoveProgMeter()


ISMENUCHECKED()

Purpose:

Determine, wether a menu entry in as user defined menu is checked.

Function Call:

RetVal=IsMenuChecked(idMenu,idItem)

Parameters:

idMenu:	Integer:	Number of the Menu
idItem:	Integer:	Number of the Menu entry

Returns:

Integer; TRUE, if menu entry is checked, FALSE if not.

 The menu number and the entry number start with 0.

Example:

If you have three menus, e.g. File, Edit and Insert. The edit menu has the following entries:

Cut, Copy, Paste, Paste Link. The Paste entry in the Edit Menu has the following position:

1,2 (Menu 1, entry 2).

Reference:

SetMenuStates()

SetCloseMenuState()


OPENFILEDIALOG()

Purpose:

Display the GetOpenFileName dialog.

Function Call:

RetVal=OpenFileDialog(Filter,Title,DefExt,StartDir,flags)

Parameters:

Filter:	String:	Filter to be displayed in the combo-box. This zero-terminated string has to be in a special format: combo-box text & CHR$(0) & Extension & CHR$(0) &  combo-box text & CHR$(0) & Extension & CHR$(0) & ....
Title:	String:	Titel to be displayed in the Caption of the dialog box. If a zero string is given, it defaults to Open File
DefExt	String:	Default extension to be added, if the user doesnt give an extension.  Note: You must give the extension alone here. e.g.: Do not give *.WAV, but give only WAV alone !!!
StartDir:	String:	The directory to display, when the dialog-box is opened. If a zero string is given, the current directory is going to be displayed
flags:	Long:	A combination of predefined constants

These constants are:

OFN_READONLY_	The Read-Only checkbox is marked, when the dialog-box is displayed
OFN_HIDEREADONLY_	Hides the Read-Only check box
OFN_NOCHANGEDIR_	The current directory is changed to the directory, which was given at its creation
OFN_SHOWHELP_	Shows the help-button
OFN_ENABLEHOOK_	Not Used
OFN_ENABLETEMPLATE_	Not Used
OFN_ENABLETEMPLATEHANDLE_	Not Used
OFN_NOVALIDATE_	Allows non-standard file characters
OFN_ALLOWMULTISELECT_	Allows multiple file-selection
OFN_EXTENSIONDIFFERENT_	Indicates that the User has set a different extension than the default extension
OFN_PATHMUSTEXIST_	The user must enter a valid path name. Otherwise a message box will be displayed
OFN_FILEMUSTEXIST_	The user must enter an existing file or a warning will be displayed
OFN_CREATEPROMPT_	If the user gives a non existing file name, a dialog will be displayed, in which the user can decide, if a new file should be created
OFN_SHAREAWARE_	The file name will be also returned, if a sharing violation has happened (Sharing violations are not yet captured !!!)
OFN_NOREADONLY_	No read-only file may be selected
OFN_NOTESTFILECREATE_	The new file will not be created until the dialog-box is closed
OFN_SHAREFALLTHROUGH_	Not yet used
OFN_SHARENOWARN_	Not yet used
OFN_SHAREWARN_	Not yet used

Returns:

String; The full path and name of the selected file or DLG_ABORT if the Cancel button has been selected. DLLERROR_ is going to be returned if a problem loading or using the DLL occured.

	Keep in mind, that not all constants are (not yet) used here. The underscore at the end of the constants is only to prevent duplicate definitions with other Access libraries. Note that this function requires COMMDLG.DLL among your path variable. The constants my only be used from within modules.

Reference:

SaveFileDialog()

Predefinded constants


PLAYWAV()

Purpose:

Playes the given wave file.

Function Call:

RetVal=PlayWav(filename As String)

Parameters:

Filename: String: full path and file name of the wave file

Returns:

Integer; <>0 no error occured; 1 if an error did occur and DLLERROR_ if the DLL was not found or an error occured during loading it.

 This function requires MMSYSTEM.DLL among your path variable. Please be also sure that your sound card and driver(s) are properly installed.

Reference:

GetWavInfo()


ReadINI()
READINI

Purpose:

Reads a value from a given INI File and a given section in that INI File

Function Call:

RetVal=ReadINI(INIFile,Section,key)

Parameters:

INIFile:	String:	Full path and filename of the INI File. If no name is given, WIN.INI is used as a filename.
Section:	String:	Section, in which the key is located
key:	String:	The key which value should be read

Returns:

String; Returns the found key or NoVal if either the INIFile, the section or the key could not be found.

 The return type is a string, no matter if the found value is a string or a number value (integer,...).

Reference:

WriteINI()


REMOVECAPTIONBAR()

Purpose:

Removes the caption of a form including system menu, closer, minimizer and maximizer.

Function Call:

RetVal=RemoveCaptionBar(Form)

Parameters:

Form: Forms-Object: The form which caption bar should be removed

Returns:

Integer; Not needed


REMOVEPROGMETER()

Purpose:

Removes the progress meter from the status line.

Function Call

RetVal=RemoveProgMeter()

Parameters:

None

Returns:

Not needed

Reference

InitProgMeter()

UpdtProgMeter()


SAVEFILEDIALOG()

registered version only

Purpose:

Display the GetOpenFileName dialog.

Function Call:

RetVal=OpenFileDialog(Filter,Title,DefExt,StartDir,flags)

Parameters:

Filter:	String:	Filter to be displayed in the combo-box. This zero-terminated string has to be in a special format: combo-box text & CHR$(0) & Extension & CHR$(0) &  combo-box text & CHR$(0) & Extension & CHR$(0) & ....
Title:	String:	Titel to be displayed in the Caption of the dialog box. If a zero string is given, it defaults to Open File
DefExt	String:	Default extension to be added, if the user doesnt give an extension. Note: Use the extension only, no wildcards !! e.g.: Do not give *.WAV, but only give WAV
StartDir:	String:	The directory to display, when the dialog-box is opened. If a zero string is given, the current directory is going to be displayed
flags:	Long:	A combination of predefined constants

These constants are:

OFN_READONLY_	The Read-Only checkbox is marked, when the dialog-box is displayed
OFN_HIDEREADONLY_	Hides the Read-Only check box
OFN_NOCHANGEDIR_	The current directory is changed to the directory, which was given at its creation
OFN_SHOWHELP_	Shows the help-button
OFN_ENABLEHOOK_	Not Used
OFN_ENABLETEMPLATE_	Not Used
OFN_ENABLETEMPLATEHANDLE_	Not Used
OFN_NOVALIDATE_	Allows non-standard file characters
OFN_ALLOWMULTISELECT_	Allows multiple file-selection
OFN_EXTENSIONDIFFERENT_	Indicates that the User has set a different extension than the default extension
OFN_PATHMUSTEXIST_	The user must enter a valid path name. Otherwise a message box will be displayed
OFN_FILEMUSTEXIST_	The user must enter an existing file or a warning will be displayed
OFN_CREATEPROMPT_	If the user gives a non existing file name, a dialog will be displayed, in which the user can decide, if a new file should be created
OFN_SHAREAWARE_	The file name will be also returned, if a sharing violation has happened (Sharing violations are not yet captured !!!)
OFN_NOREADONLY_	No read-only file may be selected
OFN_NOTESTFILECREATE_	The new file will not be created until the dialog-box is closed
OFN_SHAREFALLTHROUGH_	Not yet used
OFN_SHARENOWARN_	Not yet used
OFN_SHAREWARN_	Not yet used
OFN_OVERWRITEPROMPT_	Warns the user if he selects a file that already exists.

Returns:

The full path and name of the selected file or DLG_ABORT if the cancel button has beend selected. DLLERROR_ is returned when a problem using or loading the DLL has occured

	Keep in mind, that not all constants are (not yet) used here. The underscore at the end of the constants is only to prevent duplicate definitions with other Access libraries. Note that this function requires COMMDLG.DLL among your path variable. The constants my only be used from within modules.

Reference:

OpenFileDialog()

Predefinded constants


SETACCESSTITLE()

Purpose:

Changes the Access main window title top display e.g. a filename or a username or any other Information desired.

Function Call:

RetVal=SetAccessTitle(Text)

Parameters:

Text: String: The text to be displayed in the Access main window titelbar

Returns:

Integer; 0 if an error occured. Any other value means success.

Reference

SetAccWin()


SETACCWIN()

Purpose:

Changes the state of the Access main window. The window can be hidden, minimized and maximized and of course restored to originial size.

Function Call:

RetVal=SetAccWin(Mode)

Parameters:

Mode: One of the predifined constants

SW_HIDE_	Makes the window invisible
SW_MINIMIZE_	Minimizes the window to icon size
SW_SHOWMAXIMIZED_	Displays the Access window in its maximized size
SW_SHOWMINNOACTIVE_	Iconized the Access window, but keeps it active
SW_SHOWNORMAL_	Activates (if it was previously hidden) the Access window and restores it to its original size
SW_SHOWNOACTIVE_	Displays the Access window in tis recent size and position, except, that the current active window will remain active

Returns:

Integer; TRUE if the window was previously hidden and FALSE if it was previously visible

Reference:

SetAccessTitle()

Predefinded constants


SETCLOSEMENUSTATE()

Purpose:

Changes the close menu state from any given form (active or inactive)

Function Call:

RetVal=SetCloseMenuState(Form,Mode)

Parameters:

Form: Forms: Formular to which this should apply window handle

Mode: Integer; can be one of the following predefined constants:

SCMS_ENABLE_	Enables the system menu close entry
SCMS_DISBALE_	Disables (grays) the system menu close entry

Returns:

Integer; 0 if previously deactivated, 1 if previously activated and -1 if menu not found. This function should also be called from the OnOpen property of any form.

Reference:

Predefinded constants


SETFORMWIN()

Purpose:

Changes the state of any form indow. The window can be hidden, minimized and maximized and of course restored to originial size.

Function Call:

RetVal=SetFormWin(Form,Mode)

Parameters:

Form: Form-Object: Name of the Form which this should apply to (e.g. Forms!InforBox)

Mode: One of the predifined constants:

SW_HIDE_	Makes the window invisible
SW_MINIMIZE_	Minimizes the window to icon size
SW_SHOWMAXIMIZED_	Displays the Access window in its maximized size
SW_SHOWMINNOACTIVE_	Iconized the Access window, but keeps it active
SW_SHOWNORMAL_	Activates (if it was previously hidden) the Access window and restores it to its original size
SW_SHOWNOACTIVE_	Displays the Access window in tis recent size and position, except, that the current active window will remain active

Returns:

Integer; TRUE if the window was previously hidden and FALSE if it was previously visible

Reference:

Predefinded constants


SetFormCaptionStyle
SETFORMCAPTIONSTYLE()

registered version only

Purpose:

Display either System-Menu or maximizer or minimizer or a combination of them.

Function Call:

RetVal=SetFormCaptionStyle(Form,SystemMenu,Minimizer,Maximizer)

Parameters:

Form	Forms	Form Object to which this applies to
SystemMenu	Integer	TRUE to display, FALSE to hide it
Minimizer	Integer	TRUE to display, FALSE to hide it
Maximizer	Integer	TRUE to display, FALSE to hide it

Returns:

Integer; Not Needed


SETMENUSTATES()

Purpose:

Either checks or unchecks or grays or ungrays a user defined menu.

Function Call:

RetVal=SetMenuStates(Mode,Menu,Entry)

Parameters:

Mode: Integer: Can be one of the following

SMS_CHECK_	Checks a menu entry
SMS_UNCHECK_	Unchecks a menu entry
SMS_GRAY_	Grays a menu entry (it is not selectable any more)
SMS_UNGRAY_	Ungrays a menu entry (now selectable)
Menu: Integer: The menu number (numbering starts with 0)

Entry: Integer: The menu entry number (numbering starts with 0)

Returns:

Integer; the previous state of the menu entry or -1 if any invalid mode has been given or the menu could not be found.

Reference:

IsMenuChecked()

Predefined Constants


UPDTPROGMETER()

Purpose:

Updates the progress meter in the status line with a given value

Function Call:

RetVal=UpdtProgMeter(Value)

Parameters:

Value: Long: The percentage which to update the progress meter

Returns:

Not needed

Reference:

InitProgMeter()

RemoveProgMeter()


WRITEINI()

registered version only

Purpose:

Writes a value to a key to a specific section in the givin INI file. It can be also used to create a new INI File as well as creating a new section and/or a new key.

Function Call:

RetVal=WriteINI(INIFile,Section,Key,Value)

Parameters:

INIFile:	String:	Name of the INI File where the value should be written or Name of the new INI File.
Section:	String:	Section to write the value to or new section to be created.
Key:	String:	Key which should be written or added.
Value:	String:	Value for the key.

Returns:

Integer; 0 if an error occured (e.g. File is write protected) and 1 if the function was successful.

Reference:

ReadINI()


BWCCMSGBOX()

Purpose:

Generates a Borland-style looking message box.

Function Call:

RetVal=BWCCMsgBox(Text,Capture,flags)

Parameters:

Text:	String:	Text to appear in the message box
Caption:	String:	Title (caption) of the message box
flags:	Integer:	Flags to control the message box.

Can be a combination of the following constants:

BWCCMB_ABORTRETRYIGNORE_	The message box contains three buttons: Abort, Retry, Ignore
BWCCMB_APPLMODAL_	The user must close the message box before he can continue working
BWCCMB_DEFBUTTON1_	First button is default button
BWCCMB_DEFBUTTON2_	Second button is default button
BWCCMB_DEFBUTTON3_	Third button is default button
BWCCMB_ICONEXCLAMATION_	An exclamation mark icon is displayed in the message box
BWCCMB_ICONHAND_	A stopping hand is displayed in the message box
BWCCMB_ICONQUESTION_	A question mark icon is displayed
BWCCMB_OK_	Dialog box contains one button: OK
BWCCMB_OKCANCEL_	Dialog box contains two buttons: OK and Cancel
BWCCMB_RETRYCANCEL_	Dialog box contains two buttons: Retry and Cancel
BWCCMB_SYSTEMMODAL_	All other applications are suspended, until the user reacts to the message box
BWCCMB_TASKMODAL_	see BWCCMB_APPMODAL
BWCCMB_YESNO_	Message box contains two buttons: Yes and No
BWCCMB_YESNOCANCEL_	Message box contains three switches: Yes, No and Cancel

Returns:

Integer; The selected button. To query for the selected button, you can use one of the predefined constants.DLLERROR_if a DLL error occured (either during loading or when using it)

	Selected button:
BWCCID_ABORT_	Abort
BWCCID_CANCEL_	Cancel
BWCCID_IGNORE_	Ignore
BWCCID_NO_	No
BWCCID_OK_	Ok
BWCCID_RETRY_	Retry
BWCCID_YES_	Yes
	This function requires BWCC.DLL among your path variable. Since message boxes dont make a line wrap where you want it, you can force a line wrap simply by adding a CHR$(13)+CHR$(10) in the string, where you want a line wrap.
Reference:

Predefinded constants


PreDefConst
Predefined constants

Note:

These constants can only be used from within modules. if you want to call any function from a macro or any property you have to use the decimal value instead

OFN_ALLOWMULTISELECT_	OpenFileDialog(), SaveFileDialog()
OFN_CREATEPROMPT_	OpenFileDialog(), SaveFileDialog()
OFN_ENABLEHOOK_	OpenFileDialog(), SaveFileDialog()
OFN_ENABLETEMPLATE_	OpenFileDialog(), SaveFileDialog()
OFN_ENABLETEMPLATEHANDLE_	OpenFileDialog(), SaveFileDialog()
OFN_EXTENSIONDIFFERENT_	OpenFileDialog(), SaveFileDialog()
OFN_FILEMUSTEXIST_	OpenFileDialog(), SaveFileDialog()
OFN_HIDEREADONLY_	OpenFileDialog(), SaveFileDialog()
OFN_NOCHANGEDIR_	OpenFileDialog(), SaveFileDialog()
OFN_NOREADONLYRETURN_	OpenFileDialog(), SaveFileDialog()
OFN_NOTESTFILECREATE_	OpenFileDialog(), SaveFileDialog()
OFN_NOVALIDATE_	OpenFileDialog(), SaveFileDialog()
OFN_OVERWRITEPROMPT_	SaveFileDialog()
OFN_PATHMUSTEXIST_	OpenFileDialog(), SaveFileDialog()
OFN_READONLY_	OpenFileDialog(), SaveFileDialog()
OFN_SHAREAWARE_	OpenFileDialog(), SaveFileDialog()
OFN_SHAREFALLTHROUGH_	OpenFileDialog(), SaveFileDialog()
OFN_SHARENOWARN_	OpenFileDialog(), SaveFileDialog()
OFN_SHAREWARN_	OpenFileDialog(), SaveFileDialog()
OFN_SHOWHELP_	OpenFileDialog(), SaveFileDialog()
SW_HIDE_	SetAccWin(), SetFormWin()
SW_MINIMIZE_	SetAccWin(), SetFormWin()
SW_SHOWMAXIMIZED_	SetAccWin(), SetFormWin()
SW_SHOWMINNOACTIVE_	SetAccWin(), SetFormWin()
SW_SHOWNOACTIVATE_	SetAccWin(), SetFormWin()
SW_SHOWNORMAL_	SetAccWin(), SetFormWin()
GFSR_GDIRESOURCES_	GetFreeRes()
GFSR_SYSTEMRESOURCES_	GetFreeRes()
GFSR_USERRESOURCES_	GetFreeRes()
SCMS_DISABLE_	SetCloseMenuState()
SCMS_ENABLE_	SetCloseMenuState()
SMS_CHECK_	SetMenuStates()
SMS_GRAY_	SetMenuStates()
SMS_UNCHECK_	SetMenuStates()
SMS_UNGRAY_	SetMenuStates()
BWCCID_ABORT_	BWCCMsgBox()
BWCCID_CANCEL_	BWCCMsgBox()
BWCCID_IGNORE_	BWCCMsgBox()
BWCCID_NO_	BWCCMsgBox()
BWCCID_OK_	BWCCMsgBox()
BWCCID_RETRY_	BWCCMsgBox()
BWCCID_YES_	BWCCMsgBox()
BWCCMB_ABORTRETRYIGNORE_	BWCCMsgBox()
BWCCMB_APLLMODAL_	BWCCMsgBox()
BWCCMB_DEFBUTTON1_	BWCCMsgBox()
BWCCMB_DEFBUTTON2_	BWCCMsgBox()
BWCCMB_DEFBUTTON3_	BWCCMsgBox()
BWCCMB_ICONEXCLAMATION_	BWCCMsgBox()
BWCCMB_ICONHAND_	BWCCMsgBox()
BWCCMB_ICONQUESTION_	BWCCMsgBox()
BWCCMB_OK _	BWCCMsgBox()
BWCCMB_OK_CANCEL_	BWCCMsgBox()
BWCCMB_RETRYCANCEL_	BWCCMsgBox()
BWCCMB_SYSTEMMODAL_	BWCCMsgBox()
BWCCMB_TASKMODAL_	BWCCMsgBox()
BWCCMB_YESNO_	BWCCMsgBox()
BWCCMB_YESNOCANCEL_	BWCCMsgBox()
DLLERROR_	Ctl3DInit(), Ctl3DEnd(); BWCCMsgBox(); PlayWav(), GetWavInfo()
CTL3DNOINIT_	Ctl3DEnd()
CTL3DINITDONE__	Ctl3DInit()


Hall Of Fame

This Hall of Fame will contain the names of people, who helped me in developing this library, gave useful tips for improving the library.

Thanx to:

Thomas Müllner


Important Notice

*	These Functions are designed to work from within modules only. Some functions though are working from macros or from form properties, but not all. Sometimes you  have to design a function without parameters that calls the desired function giving the proper parameters
*	If calling functions from properties or macros, remember, that you can't use neither any constants nor TRUE or FALSE. Also you can't use hexadecimal values and the OR operator.


Order Form For Toolbox V1.1

Please fill out this Form an send it to: Feichtner Christian, Colerusstrasse 22,

A-4040 Linz, Austria, Europe.

Last Name: ___________________________________________________

First Name: ___________________________________________________

Adress: _______________________________________________________

ZIP-Code: ___________________________

City: __________________________________________________

State: _________________________________________________

Country: _______________________________________________

License reuqired:

[  ] Private License at 25 US $ + 5 US  $ S&H

[  ] Distribution License at 50 US $ + 5 US $ S&H

Please include cash only (Bills only, no coins)

Anything else will not be accepted.

Disk Size is 3 1/2" unless other is required.

Statistical Information

Where did you get your Shareware copy of WinAPI ?

[  ] BBS

[  ] FTP-Site

[  ] COMPUSERVE

[  ] VENDOR

[  ] SHAREWARE CD-ROM

[  ] OTHER: ____________________________________________________________

Suggestions:

Bugs found:


Registration Benefits

When registering, you will recieve the full version of Toolbox.

The full version does not contain the limitation for menu functions (only 3 menus with 5 entries are supported in the shareware version. Furthermore the anoying shareware reminder will not be displayed anymore.

Plus there will be some additional functions in the shareware version (they are marked with reg. ver. only in the help file). These functions are:

WRITEINI()

SAVEFILEDIALOG()

SETFORMCAPTIONSTYLE()


TOOLBOX V1.1

An Microsoft Access Library

© 1994 by Christian Feichtner

Support Shareware - register now !

Access and Windows are Trademarks of Microsoft Corp.

All other are trademakrs of their respective owners.


History

V0.0:

A collection of functions i needed for my applications

V1.0:

First official Version (Beta)

V1.1

Shareware Version

V1.1R

Registered Version


CTL3D
CTL3D.DLL

This is a dynamic link library, which is distributed with Microsoft Access.

To benefit from it, please be sure that this file resides among your path

variable. It gives your message boxes that known 3D-look.

This DLL is not included within this package.


COMMDLG
COMMDLG.DLL

This is a dynamic link library, which is distributed with Microsoft Windows ®

Version 3.1. There also comes a newer version with Microsoft Access.

To prevent unpredictable behaviour, please be sure, that this DLL is

located among your path variable. Many other Windows applications

use it as well. It provides several standard dialogs for opening and

saving files, choosing fonts, printers and colors.


Access Libraries

These are simple databases (extension *.MDA), which can be added

to Access to provide more functionality or assistance (such as wizards).

To add an library to Access, add the full file and pathname to the

libraries section in the MSACCESS.INI


Windows API

A set of functions and procedures provides by Windows, to make it

easier to develop applications.


MMSYSTEM
MMSYSTEM.DLL

Dynamic link library for Multimedia. This DLL is needed to play wave

Files and get information about it. This DLL should reside among your

path variable. Make also sure, that your soundcard and driver(s) are

installed properly.


BWCC
BWCC.DLL

This dynamic link library is distributed with Borland Pascal ® and several

shareware applications. It allows to display windows control items such as

buttons, checkboxes, ... in a special style. This DLL must reside among your

path variable.


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex: &H2; Dec: 2


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex: &H2; Dec: 2


Constant Value
Value: Hex: &H4; Dec:4


Constant Value
Value: Hex: &H8; Dec: 8


Constant Value
Value: Hex: &H10; Dec: 10


Constant Value
Value: Hex: &H20; Dec: 32


Constant Value
Value: Hex: &H40; Dec: 64


Constant Value
Value: Hex: &H80; Dec:  128


Constant Value
Value: Hex: &H100; Dec: 256


Constant Value
Value: Hex: &H200; Dec: 512


Constant Value
Value: Hex: &H400; Dec: 1024


Constant Value
Value: Hex: &H800; Dec: 2048


Constant Value
Value: Hex: &H1000; Dec: 4096


Constant Value
Value: Hex: &H2000; Dec: 8192


Constant Value
Value: Hex: &H4000; Dec: 16384


Constant Value
Value: Hex: &H8000; Dec: 32768


Constant Value
Value: Hex: &H10000; Dec: 65535


Constant Value
Value: Hex: &H2; Dec: 2


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex:&H0; Dec: 0


Constant Value
Value: Hex: &H6; Dec: 6


Constant Value
Value: Hex: &H3; Dec: 3


Constant Value
Value: Hex: &H7; Dec: 7


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex &H4; Dec: 4


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex: &H2; Hex: 2


Constant Value
Value: Hex: &H3; Hex: 3


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex: &H1; Dec: 0


Constant Value
Value: Hex: &H2; Dec: 2


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex: &H100; Dec: 256


Constant Value
Value: Hex: &H200; Dec: 512


Constant Value
Value: Hex: &H30; Dec: 48


Constant Value
Value: Hex: &H10; Dec: 16


Constant Value
Value: Hex: &H20; Dec: 32


Constant Value
Value: Hex: &H0; Dec: 0


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex: &H5; Dec: 5


Constant Value
Value: Hex: &H1000; Dec: 4096


Constant Value
Value: Hex: &H2000; Dec: 8192


Constant Value
Value: Hex: &H4; Dec: 4


Constant Value
Value: Hex: &H3; Dec: 3


Constant Value
Value: Hex: &H3; Dec: 3


Constant Value
Value: Hex: &H2; Dec: 2


Constant Value
Value: Hex: &H5; Dec: 5


Constant Value
Value: Hex: &H7; Dec: 7


Constant Value
Value: Hex: &H1; Dec: 1


Constant Value
Value: Hex: &H4; Dec: 4


Constant Value
Value: Hex: &H6; Dec: 6


Combination: use the OR (&) operator


Value: -32768


Value: -32766


Value: -32767


Path Variable

This is a DOS environment variable. MS-DOS and/or Windows use it to find applications and their components. This variable should be set in your AUTOEXEC.BAT file (refer to your DOS manual for details).


How to display a 'Borland Style message box

Use the function BwccMsgBox()to do this.


Display a message box in 3-D look

Do do this, call CTL3DInit().This will initialize the 3-D look. All message boxes and I believe the OpenFileDialog and the SaveFileDialog are going to be displayed in the 3-D look. If you don't want that 3-D look anymore call CTL3DEnd(). If you used CTL3DInit(), then your applocation should call CTL3DEnd() before quitting Access.


Center a form

Use FrmCenter(). This function should be called from within the OnOpen property. If you have more than one functions that are called from the OnOpen property, create a new module and a new function. Call each function desired to be executed from the OnOpen property from within the new function. Place the new function in the OnOpen property.

Example:

You want to center a form and disable the System Menu.

Create a new module

Create a new function (The name Opening will be used here)

Function Opening()

  Dim ret1%,ret2%

  ret1%=FrmCenter(Forms![TestForm])

  ret2%=SetFormCaptionStyle(Forms![TestForm],FALSE,TRUE,TRUE)

End Function

Substitute Forms![TestForm] with your formular name.


Display visual progress of any action

Toolbox provides three functions for this: InitProgMeter(), UpdtProgMeter(), RemoveProgMeter()

To initialize the progress meter call InitProgMeter(). This will display the progress meter with 0 % and the text given (will be displayed to the right of the progress meter).

To update the progress meter call UpdtProgMeter(). As a parameter you give the percentage completed. If you did initialize the progress meter with the value 1000 and update it with the value 348, the progress meter will display 34 %.

After the progress meter has reached 100 %, you may want to remove it. Call the function RemoveProgMeter() to do so.

Example:

...

Dim i%

InitProgMeter("Progress",1000)

FOR i=1 TO 1000

  UpdtProgMeter(i)

Next i

Remove ProgMeter()

This code will display the progress meter, update it, until it reaches 100 %. Then it is removed.


Prevent the user from closing a form with the System Menu

There are to ways to do this.

SetCloseMenuState(): Disables or enables the close entry in the system menu

SetFormCaptionStyle(): Removes the closer button on the top left corner of a window and the system menu.

Both function should be called from the OnOpen property

If you have to call more than one function from the OnOpen property, do the following.

Create a new module and a new function (name Opening will be used here) and place the function calls to be executed when the form opens in the new function.

Example:

Function Opening()

  Dim ret1%,ret2%

  ret1%=FrmCenter(Forms![TestForm])

  ret2%=SetFormCaptionStyle(Forms![TestForm],FALSE,TRUE,TRUE)

End Function


Determine, wether a menu item is checked

Use the function  IsMenuChecked()to do this.


Maintain INI Files

The Function WriteINI()can be used not only to write to INI Files, but also to create new INI Files, new sections and new keys. To create a new INI file, call the function with a INI Filename, that does not exist.

If you give a section and/or a key which do not exist, they will be created.

To read from an INI File, use the function ReadINI()


Hide/Minimize/Restore a from window

This can be done using the function SetFormWin()and one of the predefined constants.


Hide/Minimize/Restore the Access main window

This can be done using the SetAccWin()function and one of the predefined constants.


Display a different title in the Access main window

Sometimes it is useful to display something else than "Microsoft Access" in the Access main window caption. The Caption can be changed with the SetAccessTitle()function.


Determine free resources

Like you can see in many applications the Help/Info menu displays a dialog box which contains, apart from that copyright stuff, the free system resources. Now you can do the same. Use the function GetFreeRes()to do so.


Prompt the user for a filename

If you have to save or load something from a (user-defined) file, you can use the OpenFileDialog()and SaveFileDialog()functions to prompt the user for a filename. With the contants that are defined, you can gain control over those dialogs (e.g. prompt the user if a non existing file should be created, ...)


Play a wave file (on opening a form)

To play a wave file from within a module, use the function PlayWav().

This function also allows you to play a wave file on certain actions. You can e.g. play a wave file, when the user opens a form. To do this, place the following into the OnOpen property of your form:

=PlayWav("C:\WINDOWS\CHIMES.WAV")

[OnOpen: =PlayWav("C:\WINDOWS\CHIMES.WAV")]

This will play the file chimes.wav when the form opens.