Почему-то не могу получить иконки через SHGetFileInfo, хотя GetDisplayNameOf с тем же ii_list прекрасно работает и возвращает верное описание.
/ активнее используем тэг CODE - прим. модератора /
shell_fill_list proc
push esi
assume ebp:ptr exmenu_data
invoke GlobalAlloc,GMEM_FIXED,4096
mov [ebp].icons_table,eax
mov esi,eax
;and [ebp].icons_num,0
INVOKE SHGetDesktopFolder, offset i_shf;pshf
coinvoke i_shf,IShellFolder,BindToObject, [ebp].path_ofs,0,addr IID_IShellFolder,offset i_shf;i_shsubfolder
coinvoke i_shf, IShellFolder, EnumObjects, hWnd,SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or SHCONTF_INCLUDEHIDDEN,offset i_elist
xor ebx,ebx
jmp skip
next_i:
coinvoke i_shf,IShellFolder,GetDisplayNameOf,ii_list,SHGDN_NORMAL, offset my_info
call get_special_name
invoke SendMessage,mlist_h,LB_ADDSTRING,0,eax
invoke SHGetFileInfo,ii_list,0,offset my_info,sizeof my_info, SHGFI_ICON or SHGFI_SMALLICON or SHGFI_PIDL
;inc [ebp].icons_num
invoke ImageList_AddIcon,ilist_h,my_info.hIcon
mov word ptr [esi],ax
add esi,2
invoke DestroyIcon,my_info.hIcon
inc ebx
skip:
coinvoke i_elist,IEnumIDList,Next,1,offset ii_list,0
dec eax
test eax,eax
jnz next_i
coinvoke i_elist,IEnumIDList,Release
coinvoke i_shf,IShellFolder,Release
; call dump_list
pop esi
ret
shell_fill_list endp