Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21243

ImageCombo: No images on XP?

$
0
0
So I'm using an ImageCombo to display a list of directories, so need to have it associated with the system imagelist. Seems simple enough, but I was testing for XP compatibility and noticed that while it works perfectly on Win7, on XP no icons are visible, and there's not even an indent. VB imagelist works normally, so it's a little odd. Is this a known issue? I couldn't find any information about it.

Code:

Private Sub InitCBPath()
Dim hImgL As Long
hImgL = GetSystemImagelist(SHGFI_SMALLICON)

Call SendMessage(cbPath.hWnd, CBEM_SETIMAGELIST, 0, ByVal hImgL)
Call SendMessage(cbPath.hWnd, CB_SETDROPPEDWIDTH, 300&, ByVal 0&)

Call SubClass(cbPath.hWnd, AddressOf CBXWndProc)
'Add the default 'all fixed drives' item
Dim cbi As ComboItem, cbxi As COMBOBOXEXITEM
Set cbi = cbPath.ComboItems.Add(, , cFind.Path)
cbxi.iItem = cbi.Index - 1
cbxi.iImage = GetFileIconIndex(Left(cFind.Path, 3), SHGFI_SMALLICON) 'usually C:\
cbxi.mask = CBEIF_IMAGE
Call SendMessage(cbPath.hWnd, CBEM_SETITEM, 0, cbxi)
End Sub

There's no errors, and the first item is added with just the text, no icon. Same for all subsequent adds.

Viewing all articles
Browse latest Browse all 21243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>