I want to set up a ListView control so that when I drag files from Explorer
into it, the file(s) are added to the list, and the correct icon displays in
the ListView for each file.
I got the drag part, but the icon part I don't. What I'm doing is (--and I
don't know what I'm doing. I pieced my code together from Appleman's Win32
book and a project example from http://www.thescarms.com/index.htm):
- call ExtractAssociatedIcon using the file name dropped on the ListView.
- use the return value from ExtractAssociatedIcon in DrawIconEx to draw the
icon in a PictureBox.
- add a ListImage to a ImageList control, using the Image property of the
The icons drawn in the picture box are coming out right, but they're all
32x32. I want 16x16. I don't know how to control this--between
ExtractAssociatedIcon and DrawIconEx. (I tried using 16 and 16 as the
dimensions in the DrawIconEx statement, but the results were 1/4 the size I
wanted...???) The icons I'm adding to my ListView are 32x32s squished to fit
16x16--instead of the real 16x16 icons.
I've read Appleman's book as much as I can stand it. It's a good book but
I'm stuck and want someone to just tell me the answer. ;-)
Thanks for any help,