IShellView (Interfaces)
Last changed:

The IShellView interface is implemented to present a view in the Windows Explorer or folder windows

C# Definition:

  [ComImport(), Guid("000214E3-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface IShellView
        /// <summary>
        /// Get the handle of the shellview implemented
        /// </summary>
        void GetWindow( out IntPtr windowHandle);

        /// <summary>
        /// ContextSensitiveHelp

        /// </summary>
        void ContextSensitiveHelp( bool fEnterMode);

        /// <summary>
        /// Translates accelerator key strokes when a namespace extension's view has the focus
        /// </summary>
        long TranslateAcceleratorA( IntPtr message);

        /// <summary>
        /// Enables or disables modeless dialog boxes. This method is not currently implemented
        /// </summary>
        void EnableModeless( bool enable);

        /// <summary>
        /// Called when the activation state of the view window is changed by an event that is not caused by the Shell view itself. For example, if the TAB key is pressed when the tree has the focus, the view should be given the focus
        /// </summary>
        void UIActivate([MarshalAs(UnmanagedType.U4)] ActivationStates activtionState);

        /// <summary>
        /// Refreshes the view's contents in response to user input
        ///  Explorer calls this method when the F5 key is pressed on an already open view
        /// </summary>
        void Refresh();

        /// <summary>
        /// Creates a view window. This can be either the right pane of  Explorer or the client window of a folder window.
        /// </summary>
        void CreateViewWindow([In,MarshalAs(UnmanagedType.Interface)] IShellView previousShellView , [In] ref FolderSettings folderSetting,[In] IShellBrowser shellBrowser,[In] ref RECT bounds,[In,Out] ref IntPtr handleOfCreatedWindow);

        /// <summary>
        /// Destroys the view window
        /// </summary>
        void DestroyViewWindow();

        /// <summary>
        /// Retrieves the current folder settings
        /// </summary>
        void GetCurrentInfo(ref FolderSettings pfs);

        /// <summary>
        /// Allows the view to add pages to the Options property sheet from the View menu
        /// </summary>
        void AddPropertySheetPages([In,MarshalAs(UnmanagedType.U4)] uint reserved, [In]ref IntPtr functionPointer,[In] IntPtr lparam);

        /// <summary>
        /// Saves the Shell's view settings so the current state can be restored during a subsequent browsing session
        /// </summary>
        void SaveViewState();

        /// <summary>
        /// Changes the selection state of one or more items within the Shell view window
        /// </summary>
        void SelectItem( IntPtr pidlItem, [MarshalAs(UnmanagedType.U4)] uint flags);

        /// <summary>
        /// Retrieves an interface that refers to data presented in the view
        /// </summary>
        long GetItemObject([MarshalAs(UnmanagedType.U4)] SVGIO AspectOfView, ref Guid riid, ref IntPtr ppv);



public struct FOLDERSETTINGS
    public enum FOLDERVIEWMODE:uint
    FVM_AUTO = -1,    //The view should determine the best option.
    FVM_FIRST = 1,    //The minimum constant value in FOLDERVIEWMODE, for validation purposes.
    FVM_ICON = 1,     //The view should display medium-size icons.
    FVM_SMALLICON = 2,    //The view should display small icons.
    FVM_LIST = 3,     //Object names are displayed in a list view.
    FVM_DETAILS = 4,      //Object names and other selected information, such as the size or date last updated, are shown.
    FVM_THUMBNAIL =5,    //The view should display thumbnail icons.
    FVM_TILE = 6,       //The view should display large icons.
    FVM_THUMBSTRIP = 7, //The view should display icons in a filmstrip format.
    FVM_CONTENT = 8,    //Windows 7 and later. The view should display content mode.
    FVM_LAST = 8       //The maximum constant value in FOLDERVIEWMODE, for validation purposes.


    enum FOLDERFLAGS:uint
    FWF_NONE = 0x00000000,
    FWF_AUTOARRANGE = 0x00000001,
    FWF_ABBREVIATEDNAMES = 0x00000002,
    FWF_SNAPTOGRID = 0x00000004,
    FWF_OWNERDATA = 0x00000008,
    FWF_BESTFITWINDOW = 0x00000010,
    FWF_DESKTOP = 0x00000020,
    FWF_SINGLESEL = 0x00000040,
    FWF_NOSUBFOLDERS = 0x00000080,
    FWF_TRANSPARENT = 0x00000100,
    FWF_NOCLIENTEDGE = 0x00000200,
    FWF_NOSCROLL = 0x00000400,
    FWF_ALIGNLEFT = 0x00000800,
    FWF_NOICONS = 0x00001000,
    FWF_SHOWSELALWAYS = 0x00002000,
    FWF_NOVISIBLE = 0x00004000,
    FWF_NOWEBVIEW = 0x00010000,
    FWF_HIDEFILENAMES = 0x00020000,
    FWF_CHECKSELECT = 0x00040000,
    FWF_NOENUMREFRESH = 0x00080000,
    FWF_NOGROUPING = 0x00100000,
    FWF_FULLROWSELECT = 0x00200000,
    FWF_NOFILTERS = 0x00400000,
    FWF_NOCOLUMNHEADER = 0x00800000,
    FWF_EXTENDEDTILES = 0x02000000,
    FWF_TRICHECKSELECT = 0x04000000,
    FWF_AUTOCHECKSELECT = 0x08000000,
    FWF_SUBSETGROUPS = 0x20000000,
    FWF_USESEARCHFOLDER = 0x40000000,
    FWF_ALLOWRTLREADING = 0x80000000

VB Definition:

  <ComImport, Guid("000214E3-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Friend Interface IShellView
      ' Methods
      Sub AddPropertySheetPages(<In, MarshalAs(UnmanagedType.U4)> ByVal reserved As UInt32, <In> ByRef functionPointer As IntPtr, <In> ByVal lparam As IntPtr)
      Sub ContextSensitiveHelp(ByVal fEnterMode As Boolean)
      Sub CreateViewWindow(<In, MarshalAs(UnmanagedType.Interface)> ByVal previousShellView As IShellView, <In> ByRef folderSetting As FolderSettings, <In> ByVal shellBrowser As IShellBrowser, <In> ByRef bounds As RECT, <In, Out> ByRef handleOfCreatedWindow As IntPtr)
      Sub DestroyViewWindow()
      Sub EnableModeless(ByVal enable As Boolean)
      Sub GetCurrentInfo(ByRef pfs As FolderSettings)
      <PreserveSig> _
      Function GetItemObject(<MarshalAs(UnmanagedType.U4)> ByVal AspectOfView As SVGIO, ByRef riid As Guid, ByRef ppv As IntPtr) As Long
      Sub GetWindow(<Out> ByRef windowHandle As IntPtr)
      Sub Refresh()
      Sub SaveViewState()
      Sub SelectItem(ByVal pidlItem As IntPtr, <MarshalAs(UnmanagedType.U4)> ByVal flags As UInt32)
      <PreserveSig> _
      Function TranslateAcceleratorA(ByVal message As IntPtr) As Long
      Sub UIActivate(<MarshalAs(UnmanagedType.U4)> ByVal activtionState As ActivationStates)
End Interface

User-Defined Types:




IShellView on MSDN