How do I display a file’s Properties dialog from C#?

Solution is: using System.Runtime.InteropServices; [DllImport(“shell32.dll”, CharSet = CharSet.Auto)] static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo); [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] public struct SHELLEXECUTEINFO { public int cbSize; public uint fMask; public IntPtr hwnd; [MarshalAs(UnmanagedType.LPTStr)] public string lpVerb; [MarshalAs(UnmanagedType.LPTStr)] public string lpFile; [MarshalAs(UnmanagedType.LPTStr)] public string lpParameters; [MarshalAs(UnmanagedType.LPTStr)] public string lpDirectory; public int nShow; public IntPtr hInstApp; public IntPtr … Read more

Windows shell extension with C#

A Raymond’s post: Do not write in-process shell extensions in managed code. A recent follow-up: Now that version 4 of the .NET Framework supports in-process side-by-side runtimes, is it now okay to write shell extensions in managed code? The bottom line is, no, it is not okay: The Guidance for implementing in-process extensions has been … Read more

C# get thumbnail from file via windows api

Ran across this today — it’s a few months old, but it got the job done for me (on Win7, extracting thumbnails on MPEG-4 files): Source : https://github.com/dbarros/WindowsAPICodePack Nuget : https://www.nuget.org/packages/WindowsAPICodePack-Shell Code: ShellFile shellFile = ShellFile.FromFilePath(pathToYourFile); Bitmap shellThumb = shellFile.Thumbnail.ExtraLargeBitmap; Hope it helps!