In the ClearIconArray method add a c to erase command, e.g.
if ! empty(loItem.cIconLarge) and file(loItem.cIconLarge)
try
erase (loItem.cIconLarge)
catch
endtry
same for the small icon.
Also remove Fn2Lfn from CreateTmpIconFile method, it seems to work fine without it. You can send an updated version of your file to Downloads section here.
Well, I guess the end result of the whole exercise that the desired result could not be achieved using icons in the image control in the grid.
Well, sometimes the negative result is a result too. Or should I continue to beat this horse until it dies? <g>
>;-)
>
>
>>I take it back. I just checked the folder again and the icons do look like icons. I guess, they are just not shown fine in the grid. Let me remove Fn2Lfn part from the code. BTW, it's not my code, it's yours <g> I'm just a mere mortal <g>
>>
>>And, finally, the files are supposed to be deleted in the object's Destroy, but they are all here. Something is not right... Ok, let me spend few more minutes... UPDATE. Ok, found a typo in that method. I just cut and pasted your code instead of doing it with a little bit of testing. This reminds me one well-known guy here <g>
If it's not broken, fix it until it is.
My Blog