TrayAreaInjector V1.1
Using TrayAreaInjector an application can inject into the Windows
Task Bar a panel similar to the tray area and then dynamically add,
remove and modify subpanels inside it. Every subpanel contains a text
caption and an image from a list.
TrayAreaInjector was developed to offer an immediate status feedback
from some Open Tools plugins but can be used for any similar purpose.

Installation
To install TrayAreaInjector copy TrayAreaInjector.exe to a directory
of your choice, then in TrayAreaInjector.reg replace <directory>
with the path of that directory. .reg format requires that slash are
doubled, that is if your directory is C:\utils this key

[HKEY_CLASSES_ROOT\TypeLib\{98D2E34A-6707-41CC-9AAA-51370DCFB011}\1.1\0\win32]
@="<directory>\\TrayAreaInjector.exe"

becomes

[HKEY_CLASSES_ROOT\TypeLib\{98D2E34A-6707-41CC-9AAA-51370DCFB011}\1.1\0\win32]
@="C:\\utils\\TrayAreaInjector.exe"

After editing of TrayAreaInjector.reg double click it and accept the
registry modifications by clicking Ok.

Configuration
For every user application TrayAreaInjector.exe add a key named
as the application's process name under the key
HKEY_CURRENT_USER\Software\TrayAreaInjector. Under this key
there are 7 values. "AreaRect" and "WindowClass" are internally
managed and should not be changed. "FontName", "FontSize" and
"FontBold" can be changed to alter the font used for subpanels'
caption. Setting "ShowExit" to 1 enables an Exit popup item
useful during user application debug.
After being started by an user application TrayAreaInjector.exe
keeps checking for it and closes the panel in case the user
application closes without closing it before.
"InjectionCheckInterval" is the checking interval in ms.

Usage
The injected panel can be moved and resized inside the task bar
window. To move click and drag on the left side of the panel, to
resize horizontally click and drag on the upper right side of the
panel, to resize vertically click and drag on the lower right side
of the panel. Width and height of the subpanel is defined by the
user application but they are then adjusted to adapt to the panel.

Interfacing with the user application
TrayAreaInjector is an off-process COM server. Project1 (Delphi7,
W32) and Project2 (Delphi2005, .NET) constain sample of its
usage. Here is a short description of its interface.

procedure AttachTrayArea(      ProcessID: Integer;
						 const WindowClass: WideString);
  Inject into the Task Bar the panel for the calling application.
  ProcessID is the process ID of the calling application.
  WindowClass is the window class of the calling application's
  main window.

function AddPanel(const ID: WideString;
                  const Text: WideString;
                        ImageIndex: Integer;
                        Width: Integer): Integer;
  Add a subpanel to the injected panel. ID is a string used
  as key to the subpanel. If multiple AddPanel use the same key
  only the first one is executed. Text is the initial value for
  the subpanel text caption. ImageIndex is the initial value
  for the index of the image to be shown on the subpanel.
  Width is the width of the subpanel, if 0 it is automatically
  computed to offer enough space to display Text.

procedure RemovePanel(Handle: Integer);
  Remove the subpanel from the panel.

function AddPicture(Picture: OleVariant): Integer;
  Add a new image to the list inside the server and returns its
  index. This is possible only after the injected panel is visible,
  otherwise the function fails and returns -1.
  The image data should be sent as a bidimensional array with
  the bitmap pixels (Project1 contains a sample).

property PanelText[Handle: Integer]: WideString;
  The text of the subpanel.

property PanelImageIndex[Handle: Integer]: Integer;
  The index of the image to be shown on the subpanel. To remove
  the image set to -1.








