This seems to work fine on W2K, DestroyIcon returns nonzero so it is successfull.



; Load enabled icon
push LR_DEFAULTCOLOR
push 16
push 16
push IMAGE_ICON
push 2
push hInst
call LoadImage
push eax ; Save icon handle on stack

push eax
push hImageList
call ImageList_AddIcon
;pop eax ; <- do I still have to pop or will destroyicon take care of that for me
;PrintDec eax
;push eax
call DestroyIcon

Posted on 2003-07-14 21:01:05 by Gunner
No need to pop eax. If I'm not sure I usually PrintDec ESP at entry and exit to check to make sure I have popped everything and the stack balances.
PrintDec esp

push LR_DEFAULTCOLOR
push 16
push 16
push IMAGE_ICON
push 2
push hInst
call LoadImage
push eax ; Save icon handle on stack

push eax
push hImageList
call ImageList_AddIcon
;pop eax ; <- do I still have to pop or will destroyicon take care of that for me
;PrintDec eax
;push eax
call DestroyIcon
PrintDec esp

esp = 1245088
esp = 1245088
Posted on 2003-07-14 21:14:31 by donkey