I have an owner-drawn virtual listview. I set the view to LargeIcon, I set the LargeImageList to the appropriate image list, but when I call LVM_SETICONSPACING, it does not work! That is - it has no effect no matter what values I put in.
I use:
Const LVM_FIRST As Long = &H1000
Const LVM_SETICONSPACING As Long = LVM_FIRST + 53
WinAPI.SendMessage(ListView.Handle, LVM_SETICONSPACING, 0, cy * 65536 + (cx And 65535))
I also tried:
WinAPI.SendMessage(ListView.Handle, LVM_SETICONSPACING, 0, cy * 65536 + cx)
WinAPI.SendMessage(ListView.Handle, LVM_SETICONSPACING, 0, cx * 65536 + cy)
All do absolutely nothing no matter what values for cx and cy I use. I tried from small like 10 to big like 400 for both - no difference.
I tried refreshing the list afterwards - no difference. item.bounds remains unchanged, and I have a 30px tall spacing between rows of icons. How do I get rid of that spacing? I also tried variants with Ints and IntPtr-s for SendMessage.
Maybe the issue is that I use Windows 8 64 bit (though program is 32 bit)? Or the fact that in virtual mode, listview ignores this message?
I even checked that the message gets sent by trapping it in WndProc override.
Take 2:
I even tried with IntPtr as some have suggested w/o luck. I also tried all possible values for the both vertical and horizontal spacing of 5: &H50005000, &H00050005, as well as &H5000000050000000, &H0000000500000005. No difference, it is as if it is totally ignored. Maybe LVM_SETICONSPACING has a different value?
Any suggestions would be welcome.
Thank you.