TaskbarWindows.Items it’s not sorted the same way the buttons are placed on the taskbar. I tried to find the real index of the buttons but i was not successful.
How can I do that?
Code: Select all
var
k:integer;
begin
for k := 0 to TaskbarWindows.ItemCount - 1 do
begin
if not TaskbarWindows.Items[k].InTaskbar then continue;
if not TaskbarWindows.Items[k].IsStillValid then continue;
ShowMessage(
'Position in taskbar='+
inttostr(k)+//IMPORTANT! k is incorrect. Needs to be replaced with the correct index
#13'Handle = '+
inttohex(TaskbarWindows.Items[k].Handle,8)+
#13'Text='+
TaskbarWindows.Items[k].Text
);
end;
end;