addIcon return

new topic     » topic index » view thread      » older message » newer message

I found that when addIcon fails, it returns 1,
so it can refer to other icon that has index 1 on the ImageList.

How about adding
    if equal(hIcon, 0) then
        return 0
    end if
to the beginning of addIcon()?

Sample code:

include win32lib.ew
constant
win = create(Window, "win", 0, Default, Default, Default, Default, 0),
lv = create(ListView, {"column1", "column2"}, win, 0, 0, 1000, 1000, LVS_REPORT)
object ret, wk, dd
dd = dir("c:\\windows\\*.exe")
for i = 1 to 100 do
        ret = addIcon(extractIcon("c:\\windows\\" & dd[i][D_NAME]))
        ret = addLVItem(lv, ret, {dd[i][D_NAME], "xxx"})
end for
WinMain(win, Normal)

using current addIcon, some items will have incorrect icons.

Thanks!

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu