Hi Fafalone,
Thanks for the great work in this project. I am getting a no file selected message with the following code. Can you please offer some help? The image file definitely exists on disk.
Code:Private Declare Function SHCreateItemFromParsingName Lib "shell32" (ByVal pszPath As Long, pbc As Any, riid As UUID, ppv As Any) As Long Private psiFile As IShellItem Private IID_IShellItem As UUID Call SHCreateItemFromParsingName(StrPtr("C:\Users\n358924\Documents\2018-03-23 15.57.44 Ullswater.JPG"), ByVal 0&, IID_IShellItem, psiFile) If (psiFile Is Nothing) = False Then If (pCache Is Nothing) Then Set pCache = New LocalThumbnailCache End If 'Note: Many WTS options are Win8+ only. Here we're only demonstrating basic ones that are Win7+ If Option1(0).Value = True Then lOpt = WTS_EXTRACT Or WTS_SCALETOREQUESTEDSIZE If Option1(1).Value = True Then lOpt = WTS_INCACHEONLY Or WTS_SCALETOREQUESTEDSIZE If Option1(2).Value = True Then lOpt = WTS_FORCEEXTRACTION Or WTS_SCALETOREQUESTEDSIZE If Check1.Value = vbChecked Then If (Option1(0).Value = True) Or (Option1(2).Value = True) Then lOpt = lOpt Or WTS_EXTRACTDONOTCACHE End If pCache.GetThumbnail psiFile, cxThumb, lOpt, pBitmap, lFlag, btID If (pBitmap Is Nothing) = False Then pBitmap.GetSize tSZ Debug.Print "Got bitmap obj, cx=" & tSZ.CX & ",flag=0x" & Hex$(lFlag) PrintThumbID btID pBitmap.GetSharedBitmap hBmp Debug.Print "hBITMAP=" & hBmp Picture1.Cls hBitmapToPictureBox Picture1, hBmp pBitmap.Detach hBmp DeleteObject hBmp Else Debug.Print "Failed to get bitmap obj, flag=0x" & Hex$(lFlag) End If Else Debug.Print "No file selected." End End If




Reply With Quote
