=================================================
 Teraphy's Toolbar32 Tutorial - Written 06/27/99
       http://www.phrozencrew.com/~teraphy
=================================================

Introduction
------------
 Lots of people seems to have trouble creating Toolbars correctly.
 Especially when it comes to the Tooltip part. Therefore I decided
 to write this tutorial. It first describes some standard toolbar
 setup and then goes to the main part, how to create Tooltips.
 I assume you already know how to create a standard window, etc.
 Full example source code is included in the "src" directory.

Creating the Toolbar
--------------------
 To create the toolbar we use the API CreateToolbarEx. This API
 belongs to ComCtl32.dll, and therefore, start you're application
 by calling the InitCommonControls API to make sure it's loaded.

 I'll tech you how to create a simply toolbar. If you want to create
 something more advanced, I recommend you to look up CreateToolbarEx
 in your API refernce.

 To create a standard toolbar, using standard icons add this to your
 data section.
 
     TB	TBBUTTON <STD_FILEOPEN,500,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>
	TBBUTTON <STD_FILESAVE,501,0,TBSTYLE_BUTTON,0,0>
	TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>
	TBBUTTON <STD_DELETE,502,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>

 This is a description of our buttons to add. The TBBUTTON structure
 contains theese field: <iBitmap, idCommand, fsState, fsStyle, dwData, iString>.
 iBitmap	Bitmap#. We use standard bitmaps.
 idCommand	Command Identifier. Used for WM_COMMAND and similiar
 fsState	Bitmapstate. Use TBSTATE_ENABLED for Std button, and zer
		for disabled buttons.
 fsStyle	Use TBSTYLE_BUTTON for Std button, and TBSTYLE_SEP for
		separators.
 dwData		See your API reference. Set to zero for std use.
 iString	See your API reference. Set to zero for std use.

 CreateToolbarEx API should also be used. Add this to your WM_CREATE or
 WM_INITDIALOG handler.
	invoke CreateToolbarEx, \
		 hWnd, WS_CHILD+WS_BORDER+WS_VISIBLE+TBSTYLE_TOOLTIPS+CCS_ADJUSTABLE, \
		 450, 4, HINST_COMMCTRL, IDB_STD_SMALL_COLOR, addr TB, \
		 4, 16, 16, 16, 16, size TBBUTTON
 Look up the API in your refernce to get description of all fields.
 TBSTYLE_TOOLTIPS must be used as style to be able to create Tooltips.
 450 specifies the Identifier for the Toolbar. The following 4 specifies
 the number of bitmaps to add. Set this to the number of buttons to add.
 The 4 on the line below is the number of buttons to add. Just let them
 be equal. HINST_COMMCTRL is used to identify that we want to use standard
 bitmaps. You can choose to create a bitmap file of your own, and load the
 bitmaps from that file.
 IDB_STD_SMALL_COLOR specifies standard small colored buttons.
 The last one is used to identify what version of TBBUTTON structure is used,
 set it to the size of TBBUTTON.

 To create functions for your toolbar, just respond to WM_COMMAND.

Adding Tooltips
---------------
 To use the tooltips you need to set TBSTYLE_TOOLTIPS when you create your toolbar
 as in the example above.
 Creating tooltips is easy. Put your desired tooltip text in the .data section.
	.data
	szTipOpen	db 'Open File',0
	szTipSave	db 'Save File',0
	szTipExit	db 'Exit Application',0
 And then add this code to your Window or Dialog handler.
	.IF wMsg==WM_NOTIFY
	mov ebx,[lParam]
		.IF dword ptr [ebx+8] == TTN_NEEDTEXT
			mov eax,dword ptr [ebx+4]
			.IF eax==500
				mov dword ptr [ebx+12], offset szTipOpen
			.ELSEIF eax==501
				mov dword ptr [ebx+12], offset szTipSave
			.ELSEIF eax==502
				mov dword ptr [ebx+12], offset szTipExit
			.ENDIF
		xor eax,eax
		ret
		.ENDIF
	.ENDIF
 The toolbar will send out a TTN_NEEDTEXT message in WM_NOTIFY form.
 All you need to do, is simply fill out the offset of your tooltip
 text to one the specified posistion. This is made by the above code.

 Try to run the included example and see. Creating tooltips really is
 this easy.

