Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1449

Simpliest way to get a pointer to IShellItemImageFactory

$
0
0
Here is the most simpliest way to get access to the images/icons/thumbnails!!
All you need is a typelib that supports IShellItem and IShellItemImageFactory.

Here we go!!

Code:


Public Function ShGetIShellItemFromItemId(ByVal pidl As Long, ByRef pISI As IShellItem) As Long
  Dim hr As Long
 
  Set pISI = Nothing
 
  If pidl = 0 Then Exit Function
 
  hr = SHCreateItemFromIDList(pidl, IID_IShellItem, pISI)
 
  ShGetIShellItemFromItemId = hr
End Function


Public Function ShIShellItemImageFactory(ByVal pidl As Long, ByRef pISIIF As IShellItemImageFactory) As Long
  Dim hr As Long
  Dim pISI As IShellItem
 
  hr = ShGetIShellItemFromItemId(pidl, pISI)
 
  If hr = S_OK Then
    Set pISIIF = pISI
  End If
End Function

Cheers and have fun :wave: :p:cool:

Viewing all articles
Browse latest Browse all 1449

Trending Articles



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