I have difficulty following the code without proper formatting and code tags. You definitely don't want to be populating the list in WM_PAINT. What happens if you try to populate the list after the call to CreateWindowEx() instead of in WM_CREATE? I know that WM_CREATE is sent before CreateWindowEx() returns so maybe something weird is happening there.
I have found where it was wrong i solved it i could display thumbnail images in listview control successfully.
In Listview control i need a selection box which should be highlighted on selecting the thumbnail image how to do this.
and also how to align the thumbnail image to center in listview control window,and also how to apply styles to the listview control.
Example:as thumbnail images viewed in windows explorer,in which we get a selection box around the selected item and highlighted.