Click here to Skip to main content
11,479,034 members (62,823 online)
Click here to Skip to main content
Add your own
alternative version

.NET Shell Extensions - Shell Preview Handlers

, 20 May 2014 MIT 29.7K 2.4K 56
Quickly create Shell Preview Handlers for Windows or Outlook using .NET!
SharpShell_Core_Library.zip
SharpShell.dll
SharpShell_Source_Code.zip
SharpShell Source Code
Dependencies
Apex
Apex.WinForms.dll
SharpShell
packages
Apex.1.5.0
Apex.1.5.0.nupkg
lib
net35
Apex.dll
net40
Apex.dll
sl30
Apex.Silverlight.dll
sl3-wp
Apex.WP7.dll
sl40
Apex.Silverlight4.dll
sl4-wp71
Apex.WP7.dll
sl50
Apex.Silverlight.dll
ILMerge.2.12.0803
ILMerge.2.12.0803.nupkg
ILMerge.doc
ILMerge.exe
NUnit.2.6.2
lib
nunit.framework.dll
NUnit.2.6.2.nupkg
NUnit.2.6.2.nuspec
Samples
ContextMenu
ContextMenuComponent
Properties
ContextMenuSample
Properties
CountLinesExtension
CountLinesExtension.csproj.vspscc
Key.snk
Properties
Resources
CountLines.bmp
DllContextMenuExtension
DllContextMenuExtension.csproj.vspscc
Key.snk
Properties
IsolatedContextMenuComponent
Diagnostics
Interop
Properties
ServerRegistration
SharpContextMenu
DropHandler
XsdDropHandler
ExampleFiles
Key.snk
Properties
XsdDropHandler.csproj.vspscc
IconHandler
DllIconHandler
DllIconHandler.csproj.vspscc
Key.snk
Properties
Resources
ManagedDll.ico
NativeDll.ico
IconOverlayHandler
ReadOnlyFileIconOverlayHandler
Key.snk
Properties
ReadOnlyFileIconOverlayHandler.csproj.vspscc
Resources
ReadOnly.ico
InfoTipHandler
FolderInfoTipHandler
FolderInfoTipHandler.csproj.vspscc
Key.snk
Properties
PreviewHandler
IconPreviewHandler
Dependencies
IconLib.dll
IconLib.dll
IconPreviewHandler.csproj.user
IconPreviewHandler.csproj.vspscc
Key.snk
Properties
PropertySheet
DrivePropertySheet
DrivePropertySheet.csproj.vspscc
Key.snk
Properties
ResourcesPropertySheet
Key.snk
Properties
ResourcesPropertySheet.csproj.vspscc
TextFilePropertySheet
Key.snk
Properties
TextFilePropertySheet.csproj.vspscc
SharpShell
Attributes
Diagnostics
Extensions
Interop
Key.snk
NativeBridge
SharpShellNativeBridge32.dll
SharpShellNativeBridge64.dll
Properties
ServerRegistration
SharpContextMenu
SharpDropHandler
SharpIconHandler
SharpIconOverlayHandler
SharpInfoTipHandler
SharpPreviewHandler
SharpPropertySheet
SharpShell.csproj.user
SharpShell.csproj.vspscc
SharpShellNativeBridge
SharpShellNativeBridge.aps
SharpShellNativeBridge.vcxproj.filters
SharpShellNativeBridge.vcxproj.user
SharpShellNativeBridge.vcxproj.vspscc
SharpShellNativeBridge1.aps
Tools
ExtensionManager
Properties
Settings.settings
Resources
xsd.ico
ServerInspector
Properties
Settings.settings
ServerInspector.csproj.vspscc
Servers
ServerManager
About
LogView
Properties
Settings.settings
Resources
ChangeYourView.png
ContextMenu.png
Icon.png
IconOverlayHandler.png
InfoTip.png
openHS.png
PlayHS.png
PropertySheet.png
View_Details.png
View_LargeIcons.png
View_List.png
View_SmallIcons.png
View_Tiles.png
ServerDetails
ServerManager.csproj.user
ServerManager.csproj.vspscc
SharpShell.ico
TestShell
ShellExtensionManager
Properties
Settings.settings
ShellExtensionManager.csproj.vspscc
SharpShell_Tools.zip
SharpShell.dll
Apex.WinForms.dll
ServerManager.exe
Apex.dll
ServerInspector.exe
using System;

namespace SharpShell.Interop
{
    /// <summary>
    /// Contains information used by ShellExecuteEx.
    /// </summary>
    public struct SHELLEXECUTEINFO
    {
        /// <summary>
        /// Required. The size of this structure, in bytes.
        /// </summary>
        public int cbSize;

        /// <summary>
        /// Flags that indicate the content and validity of the other structure members.
        /// </summary>
        public SEE fMask;

        /// <summary>
        /// Optional. A handle to the parent window, used to display any message boxes that the system might produce while executing this function. This value can be NULL.
        /// </summary>
        public IntPtr hwnd;

        /// <summary>
        /// A string, referred to as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. This parameter can be NULL, in which case the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry.
        /// </summary>
        public string lpVerb;

        /// <summary>
        /// The address of a null-terminated string that specifies the name of the file or object on which ShellExecuteEx will perform the action specified by the lpVerb parameter. The system registry verbs that are supported by the ShellExecuteEx function include "open" for executable files and document files and "print" for document files for which a print handler has been registered. Other applications might have added Shell verbs through the system registry, such as "play" for .avi and .wav files. To specify a Shell namespace object, pass the fully qualified parse name and set the SEE_MASK_INVOKEIDLIST flag in the fMask parameter.
        /// </summary>
        public string lpFile;

        /// <summary>
        /// Optional. The address of a null-terminated string that contains the application parameters. The parameters must be separated by spaces. If the lpFile member specifies a document file, lpParameters should be NULL.
        /// </summary>
        public string lpParameters;

        /// <summary>
        /// Optional. The address of a null-terminated string that specifies the name of the working directory. If this member is NULL, the current directory is used as the working directory.
        /// </summary>
        public string lpDirectory;

        /// <summary>
        /// Required. Flags that specify how an application is to be shown when it is opened; one of the SW_ values listed for the ShellExecute function. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it.
        /// </summary>
        public int nShow;

        /// <summary>
        /// [out] If SEE_MASK_NOCLOSEPROCESS is set and the ShellExecuteEx call succeeds, it sets this member to a value greater than 32. If the function fails, it is set to an SE_ERR_XXX error value that indicates the cause of the failure. Although hInstApp is declared as an HINSTANCE for compatibility with 16-bit Windows applications, it is not a true HINSTANCE. It can be cast only to an int and compared to either 32 or the following SE_ERR_XXX error codes.
        /// </summary>
        public IntPtr hInstApp;

        /// <summary>
        /// The address of an absolute ITEMIDLIST structure (PCIDLIST_ABSOLUTE) to contain an item identifier list that uniquely identifies the file to execute. This member is ignored if the fMask member does not include SEE_MASK_IDLIST or SEE_MASK_INVOKEIDLIST.
        /// </summary>
        public IntPtr lpIDList;

        /// <summary>
        /// The address of a null-terminated string that specifies one of the following:
        ///     A ProgId. For example, "Paint.Picture".
        ///     A URI protocol scheme. For example, "http".
        ///     A file extension. For example, ".txt".
        ///     A registry path under HKEY_CLASSES_ROOT that names a subkey that contains one or more Shell verbs. This key will have a subkey that conforms to the Shell verb registry schema, such as
        ///     shell\verb name
        /// </summary>
        public string lpClass;

        /// <summary>
        /// A handle to the registry key for the file type. The access rights for this registry key should be set to KEY_READ. This member is ignored if fMask does not include SEE_MASK_CLASSKEY.
        /// </summary>
        public IntPtr hkeyClass;

        /// <summary>
        /// A keyboard shortcut to associate with the application. The low-order word is the virtual key code, and the high-order word is a modifier flag (HOTKEYF_). For a list of modifier flags, see the description of the WM_SETHOTKEY message. This member is ignored if fMask does not include SEE_MASK_HOTKEY.
        /// </summary>
        public int dwHotKey;

        /// <summary>
        /// A handle to the icon for the file type. This member is ignored if fMask does not include SEE_MASK_ICON. This value is used only in Windows XP and earlier. It is ignored as of Windows Vista.
        /// </summary>
        public IntPtr hIcon;

        /// <summary>
        /// A handle to the monitor upon which the document is to be displayed. This member is ignored if fMask does not include SEE_MASK_HMONITOR.
        /// </summary>
        public IntPtr hProcess;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

Dave Kerr
Software Developer
United Kingdom United Kingdom
Follow my blog at www.dwmkerr.com and find out about my charity at www.childrenshomesnepal.org.
Follow on   Twitter

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 20 May 2014
Article Copyright 2013 by Dave Kerr
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid