You might not be aware of the TTaskbar
taskbar-configuration component and its OverlayIcon
property.
Example:

with a very straightforward implementation:
procedure TForm1.btnInfoClick(Sender: TObject);
var
io: TIcon;
begin
io := TIcon.Create;
try
io.Handle := LoadIcon(0, IDI_INFORMATION);
Taskbar1.OverlayIcon := io
finally
io.Free;
end;
end;
In your case, you can either create icons 1.png
, 2.png
, ... non-programmatically and use those, or you can create icons programmatically (create a CreateOverlayIcon(ANumber: Integer): TIcon
function).
I should warn you, however, that the TTaskbar
component used to be (very) buggy. Therefore I would not use that one; instead, I would use the ITaskbarList3::SetOverlayIcon
API directly.
In any case, my suggestion is to split your problem into two parts:
- Create overlay icons.
- Use the Windows 7 taskbar overlay icon feature to display these on top of your original icon.