var
TheAppBar: TTheAppBar;
AppData: _AppBarData;
//Appbars structure
implementation
{$R *.dfm}
procedure TTheAppBar.FormCreate(Sender: TObject);
var
MTheAppBar: hwnd;
begin
MTheAppBar := Application.handle;
//apps handle
with AppData
do //structure setup
begin
AppData.cbSize := 20;
Appdata.hWnd := MTheAppBar;
AppData.uEdge := ABE_LEFT;
AppData.rc.Left := 30;
AppData.rc.Top := 30;
AppData.rc.Right := 30;
AppData.rc.Bottom := 30;
end;
end;
procedure TTheAppBar.Button1Click(Sender: TObject);
begin
SHAppBarMessage(ABM_NEW, AppData);
//Add to system list
SHAppBarMessage(ABM_ACTIVATE, AppData);
//Activate ot
SHAppBarMessage(ABM_SETPOS, AppData);
//Position it
end;
procedure TTheAppBar.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
SHAppBarMessage(ABM_REMOVE, AppData);
//Remove it on close
end;
procedure TTheAppBar.Button2Click(Sender: TObject);
begin
MoveWindow(AppData.hWnd, AppData.rc.left, AppData.rc.top, AppData.rc.right - AppData.rc.left, AppData.rc.bottom -
AppData.rc.top, TRUE);
//Move the appbar into the specified rect
end;
end.