unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ShellAPI;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
result: integer;
Data: TAppBarData;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
DAta.cbSize := SizeOf(TAppBarData);;
Data.hWnd := Form1.Handle;
Data.uEdge := ABE_TOP;
Data.rc.Left := 0;
Data.rc.Top := 0;
Data.rc.Right := 0;
Data.rc.Bottom := 60;
result := SHAppBarMessage(ABM_NEW, Data);
if Result = 0 then
begin
ShowMessage('AppBar konnte nicht registriert werden');
exit;
end;
SHAppBarMessage(ABM_QUERYPOS, Data);
SHAppBarMessage(ABM_SETPOS, Data);
MoveWindow(Data.hWnd, Data.rc.Left, Data.Rc.Top, GetSystemMetrics(SM_CXSCREEN), Data.rc.Bottom, true);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
SHAppBarMessage(ABM_REMOVE, Data);
end;
end.