Here is what i did:
Approach 1:
1. Add one icon to the ImageList
2. Set ListView.Icons to ImageList
3. Set ListView.OLEDropMode to 1
4. In ListView.OleDragDrop Event, add ...
___a) check if GetFormat(15) is true
___b) use SHGetFileInfo() to get drop file name
___c) Get Icon handle
___d) API Call: ImageList_ReplaceIcon(hImageList, -1, hIcon), and return value is valid (2)
___e) call ListView.ListItems.Add() to add new Item, failed, index of out of bound
___f) check ImageList.ListImages.Count, it is one, which means no new icon is added
Approach Two:
1. Add one icon to the ImageList
2. SendMessage(hListView, 0x1003, 0, hImageList), failed, return is not valid (0), which mean cannot associate the Imagelist with ListView.
Any suggestion?
Approach 1:
1. Add one icon to the ImageList
2. Set ListView.Icons to ImageList
3. Set ListView.OLEDropMode to 1
4. In ListView.OleDragDrop Event, add ...
___a) check if GetFormat(15) is true
___b) use SHGetFileInfo() to get drop file name
___c) Get Icon handle
___d) API Call: ImageList_ReplaceIcon(hImageList, -1, hIcon), and return value is valid (2)
___e) call ListView.ListItems.Add() to add new Item, failed, index of out of bound
___f) check ImageList.ListImages.Count, it is one, which means no new icon is added
Approach Two:
1. Add one icon to the ImageList
2. SendMessage(hListView, 0x1003, 0, hImageList), failed, return is not valid (0), which mean cannot associate the Imagelist with ListView.
Any suggestion?