TCAppBar ReadMe

NOTE: Please read the whole readme file before using, including the Note from FreeVBCode.com at the end.

The TCAppBar Class was written in VB 6 and allows you to turn any control with an hwnd property into an enhanced Desktop Application Bar.

To use a given form (or say picturebox) as a desktop application bar, just use the Attach function of the class with the parameter of long type, which is actually hwnd of the control or the form.

To restore the state of the form or control, use the Detach function of the class.

All properties of the class are self-explanatory, for instance:

AllowLeft - shall we allow the user to dock the application bar to the left edge of the screen
AllowFloat - shall we allow the user to make the bar floating (Windows taskbar does not allow that)
AlwaysOnTop and Autohide properties allow use to set the application bar behaviour(equivalent to the same properties of the Windows Taskbar)
EDGE property lets you set the application bar position in code

Just as you invoke Attach (hwnd) function, your form or control gets rid of all parent HWNDS if any and use the Desktop window as parent. It also gets WS_EX_TOOLWINDOW bit on in the extended window properties sheet, since any desktop application bar must be a Toolwindow, all the window styles are set automatically upon changing the position of the bar.

You can either turn on or off the sliding effect with SlideEffect property

Code example:

Open new project. Form1 is automatically created. In the code of the form put the following:

Option Explicit
Private WithEvents appBar As TCAppBar ' in the General Declarations section of the form

Private Sub Form_Load()
    Set appBar = New TCAppBar
    appBar.Attach Me.hWnd
    appBar.EDGE = ABE_LEFT
    appBar.AllowFloat = False
    appBar.SlideEffect = false
End Sub

Private Sub Form_Unload(Cancel As Integer)
    appBar.Detach
    Set appBar = Nothing
End Sub

Run the project. Your form will be docked to the left edge of the screen and floating for this form will not be allowed, but you can drag it to any other edge of the screen. This form became fully functional Desktop Application Bar which is aware of other Application bars like Windows Taskbar and full screen applications.


NOTE:  In FreeVBCode.com's testing of this component, we found the following:

1.  Running within the IDE along with another .exe in a project group would cause Visual Basic to error out with a GPF.  Thus, we recommend compiling your application in order to test it.

2. We got the best results when:

	-- calling the attach method before calling other methods
	-- setting the AllowFloat and SlideEffect properties to false.

3. If these guidelines are followed, this is a very useful component for creating an application that function like a taskbar.
