List view doesn't want to make friends with image list
-
At least in my case. What I am trying to do is to obtain an icon from an executable and to add it among with exe name to the report-styled list control.
if(ExtractIconEx(str,0,NULL,NULL,0) > 0) { ExtractIconEx(str,0,NULL,&hIcon,1); m_plistIcons->Add(hIcon); } else m_plistIcons->Add(m_hIcon);
What I get is while every run the handle is different and after the loop ends image list contains 37 entries the only icon which is applied to absolutly all list items is the first added to the image list. Image list is being attached to list control using this line:m_ProcList.SetImageList(m_plistIcons,LVSIL_SMALL);
I am quite sure I'm doing something wrong. I just dunno what. -- modified at 4:49 Saturday 10th December, 2005 -
At least in my case. What I am trying to do is to obtain an icon from an executable and to add it among with exe name to the report-styled list control.
if(ExtractIconEx(str,0,NULL,NULL,0) > 0) { ExtractIconEx(str,0,NULL,&hIcon,1); m_plistIcons->Add(hIcon); } else m_plistIcons->Add(m_hIcon);
What I get is while every run the handle is different and after the loop ends image list contains 37 entries the only icon which is applied to absolutly all list items is the first added to the image list. Image list is being attached to list control using this line:m_ProcList.SetImageList(m_plistIcons,LVSIL_SMALL);
I am quite sure I'm doing something wrong. I just dunno what. -- modified at 4:49 Saturday 10th December, 2005Nobody knows ? Not a single human being ? I take help from aliens as well...as long as you speak the language I speak :)
-
Nobody knows ? Not a single human being ? I take help from aliens as well...as long as you speak the language I speak :)
Maybe it depends on how you add the items to your list control. By default the CListCtrl assumes to use image 0 for all items. You have to specify for every item which image it should use.
-
Maybe it depends on how you add the items to your list control. By default the CListCtrl assumes to use image 0 for all items. You have to specify for every item which image it should use.
Wow. Some people wonder outside of page 1 :) Anyway I've figured it out on my own but thanks anyway. -------------------------------- Human stupidity is infinite.