Maybe not sure but could this be the Problem:
I first need to tell I'm using a Grid to display most information of the processes , threads and of course the icons of them...
Grid is from Bergsoftware.net
So I was playing around with the MadKernel.Icon(...ExeFile, True, False); routine and noticed that Exefile needs the full path of the exefile (hope I'm right here...
So I started like this:
Code: Select all
procedure TForm1.FormShow(Sender: TObject);
var I : Integer;
StripP,
StripE,
Whole : String;
begin
GridView1.ClearRows;
EnableAllPrivileges;
GridView1.BeginUpdate;
ConvertTo32BitImageList(ImageList2);
with Processes do
For I := 0 To ItemCount -1 Do
Begin
GridView1.AddRow(1);
ImageList2.AddIcon(Image1.Picture.Icon);
GridView1.Cell[1, I].AsString := ExtractFileName(Items[I].ExeFile);
GridView1.Cell[2, I].AsString := ExtractFilePath(Items[I].ExeFile);
GridView1.Cell[3, I].AsString := IntToStr(Items[I].ID);
GridView1.Cell[4, I].AsString := IntToStr(Processes[I].Threads.ItemCount);
StripP := ExtractFilePath(Items[I].ExeFile);
StripE := ExtractFileName(Items[I].ExeFile);
Whole := StripP + StripE;
Image1.Picture.Icon.Handle := MadKernel.Icon(Whole, True, False);
ImageList2.AddIcon(Image1.Picture.Icon);
GridView1.EndUpdate;
end;
end;
In "Whole" i putted together the filename and the path to the executeable while Madkernel.Icon should extract the icon and put it into the Image component then into the Imagelist...
The Gridview always display's just a folder icon doesn't matter what executeable it is...
The crazy thing is when I do it manually like using an image1 and just the gridview while clicking on an item i'll extract the icon for that file and display it in the image this works without any problems
Madshi do you know whats up???
regards
s!