// --- Variante 1 ---
function TaskLeiste: THandle;
begin
Result := FindWindow('Shell_TrayWnd', nil);
Result := FindWindowEx(Result, 0, 'ReBarWindow32', nil);
Result := FindWindowEx(Result, 0, 'MsTaskSwWClass', nil);
end;
procedure TForm1.Button6Click(Sender: TObject);
begin
ShowWindow(TaskLeiste, SW_HIDE);
end;
procedure TForm1.Button7Click(Sender: TObject);
begin
ShowWindow(TaskLeiste, SW_SHOW);
end;
// --- Variante 2 ---
function Taskbar: THandle;
var
H: THandle;
TaskW: function: THandle; stdcall;
begin
H := GetModuleHandle('user32.dll');
if (H > 0) then begin
@TaskW := GetProcAddress(H, 'GetTaskmanWindow');
if Assigned(TaskW) then Result := GetParent(TaskW)
else Result := 0;
end else Result := 0;
end;
procedure TForm1.Button8Click(Sender: TObject);
begin
ShowWindow(TaskBar, SW_HIDE);
end;
procedure TForm1.Button9Click(Sender: TObject);
begin
ShowWindow(TaskBar, SW_SHOW);
end;