title: C#: Get file large thumbnails/previews, instead of large icons, using SHGetImageList and SHGetFileInfo, like Windows Explorer
body: <p>I'm using C#, Windows Forms, Net 2.0.</p>
  
  <p>I'm using SHGetImageList to get the system image list with, let's say, SHIL_JUMBO parameter and get large 256x256 images on Windows 7.</p>
  
  <pre><code>[DllImport(SHELL32, EntryPoint = "#727")]
  public static extern int SHGetImageList(int imageList, ref Guid riid, ref IntPtr handle);
  
  public static IntPtr Get(SystemImageListType type)
  {
      IntPtr handle = IntPtr.Zero;
      NativeMethods.SHGetImageList((int)type, ref NativeMethods.IIDImageList, ref handle);
      return handle;
  }
  </code></pre>
  
  <p>I'm also using</p>
  
  <pre><code>NativeMethods.SendMessage(listView.Handle, LVM_SETIMAGELIST, LVSIL_NORMAL, imageListHandle);
  </code></pre>
  
  <p>to set the system image list to my listview, and</p>
  
  <pre><code>public static int GetFileIconIndex(string pathName)
  {
      NativeMethods.SHFILEINFO shfiData = new NativeMethods.SHFILEINFO();
  
      NativeMethods.SHGetFileInfo(
          pathName,
          0,
          ref shfiData,
          Marshal.SizeOf(typeof(NativeMethods.SHFILEINFO)),
          NativeMethods.SHGFI.SYSICONINDEX |
          NativeMethods.SHGFI.LARGEICON |
          NativeMethods.SHGFI.ICON );
      return shfiData.iIcon;
  }
  </code></pre>
  
  <p>to get the icon index of different files/folders loaded in the listview.</p>
  
  <p>Everything works fine, except I get large 256 icons even for movie or image files, where I would expect a thumbnail (preview of the image/movie), like in Windows Explorer.</p>
  
  <p>How can I get the thumbnails, not the icons for files that are displayed as thumbnails in Windows Explorer?</p>