Creating thumbnail previews in VB.NET-Collection of common programming errors
So if you run the application in debug mode, take it out of the try/catch block and you get no error at all? What happens when the application crashes, is there an exception message?. If you are still not getting an exception at all, I am not sure what to make of that. I am guessing it has something to do with an exception in the unmanaged windows code not being thrown or bubbled back up correctly.
Instead of using the shell code from the post you referenced, you could use Image.GetThumbnail from the .NET framework for images (very simple), and a call to direct show to grab thumbnails for any supported video types.
Image :
// create an image object, using the filename of the file
System.Drawing.Image image = System.Drawing.Image.FromFile(filename);
// create the actual thumbnail image
System.Drawing.Image thumbnailImage = image.GetThumbnailImage(64, 64, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
public bool ThumbnailCallback()
{
return true;
}
Video :
Check the post at : Video Thumbnail Creator