Pat maybe the probs with the icon handle, by not pre-allocating it?. try the
following;
function AddIcon(FileName:string; FileIndex:word):integer;
var FileCon:hicon;
begin
FileCon:=ExtractAssociatedIcon(hInstance,PChar(FileName),FileIndex);
if FileCon.Handle <> nil
then Result:=ImageList.AddIcon(FileCon)
else Result:=-1;
end;
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz