You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, the app kept crashing on my PC. I changed the following function and it now very stable.
using System.IO;
`public void PreloadThumbnail(string filePath)
{
IShellItem shellItem = null;
ISharedBitmap bmp = null;
WTS_CACHEFLAGS cFlags;
WTS_THUMBNAILID bmpId;
FileAttributes attr = File.GetAttributes(filePath);
if (!attr.HasFlag(FileAttributes.Directory))
{
try
{
SHCreateItemFromParsingName(filePath, IntPtr.Zero, iIdIShellItem, out shellItem);
//TBCache.GetThumbnail(shellItem, 128, WTS_FLAGS.WTS_EXTRACTINPROC, out bmp, out cFlags, out bmpId);
TBCache.GetThumbnail(shellItem, 128, WTS_FLAGS.WTS_EXTRACT, out bmp, out cFlags, out bmpId);
}
catch (Exception)
{
//Do nothing
}
}
if (bmp != null) Marshal.ReleaseComObject(bmp);
if (shellItem != null) Marshal.ReleaseComObject(shellItem);
bmp = null;
shellItem = null;
}`
The text was updated successfully, but these errors were encountered:
Hi, the app kept crashing on my PC. I changed the following function and it now very stable.
using System.IO;
`public void PreloadThumbnail(string filePath)
{
IShellItem shellItem = null;
ISharedBitmap bmp = null;
WTS_CACHEFLAGS cFlags;
WTS_THUMBNAILID bmpId;
The text was updated successfully, but these errors were encountered: