procedure TForm1.Timer1Timer(Sender: TObject); begin if ForegroundTask then begin ListBox1.Items.Add('ForegroundTask: igen'); end else begin ListBox1.Items.Add('ForegroundTask: nem'); end; ListBox1.ItemIndex:=ListBox1.Items.Count-1; end;