Added remaining, supported interfaces from shobjidl.h

pull/133/head
dahall 2020-06-03 14:40:27 -06:00
parent 2b87264c62
commit e9ed356b8f
17 changed files with 2148 additions and 4 deletions

View File

@ -0,0 +1,146 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Values that indicate the reason that a docked accessibility app window has been undocked. Used by IAccessibilityDockingServiceCallback::Undocked.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/ne-shobjidl-undock_reason typedef enum UNDOCK_REASON {
// UR_RESOLUTION_CHANGE, UR_MONITOR_DISCONNECT } ;
[PInvokeData("shobjidl.h", MSDNShortId = "NE:shobjidl.UNDOCK_REASON")]
public enum UNDOCK_REASON
{
/// <summary>The accessibility window was undocked because the screen resolution has changed.</summary>
UR_RESOLUTION_CHANGE,
/// <summary>The monitor on which the accessibility window was docked has been disconnected.</summary>
UR_MONITOR_DISCONNECT,
}
/// <summary>
/// Docks an application window to the bottom of a monitor when a Windows Store app is visible and not snapped, or when the launcher
/// is visible.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iaccessibilitydockingservice
[ComImport, Guid("8849DC22-CEDF-4C95-998D-051419DD3F76"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(AccessibilityDockingService))]
public interface IAccessibilityDockingService
{
/// <summary>Retrieves the dimensions available on a specific screen for displaying an accessibility window.</summary>
/// <param name="hMonitor">
/// <para>Type: <c>HMONITOR</c></para>
/// <para>
/// The handle of the monitor whose available docking size is to be retrieved. For information on how to retrieve an
/// <c>HMONITOR</c>, see MonitorFromWindow.
/// </para>
/// </param>
/// <param name="pcxFixed">
/// <para>Type: <c>UINT*</c></para>
/// <para>
/// When this method returns successfully, this parameter receives the fixed width, in physical pixels, available for docking on
/// the specified monitor. Any window docked to this monitor will be sized to this width.
/// </para>
/// <para>If the method fails, this value is set to 0.</para>
/// <para>If this value is <c>NULL</c>, an access violation will occur.</para>
/// </param>
/// <param name="pcyMax">
/// <para>Type: <c>UINT*</c></para>
/// <para>
/// When this method returns successfully, this parameter receives the maximum height, in physical pixels, available for a
/// docked window on the specified monitor.
/// </para>
/// <para>If the method fails, this value is set to 0.</para>
/// <para>If this value is <c>NULL</c>, an access violation will occur.</para>
/// </param>
/// <remarks>
/// <para>When to use</para>
/// <para>
/// A docked accessibility window is limited in the amount of space that it can use on any screen. Therefore, before trying to
/// dock an accessibility window, call this function to get the available dimensions. You cannot dock any window that would
/// cause a Windows Store app to have access to less than 768 vertical screen pixels.
/// </para>
/// <para>Examples</para>
/// <para>This example shows this method in use.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iaccessibilitydockingservice-getavailablesize HRESULT
// GetAvailableSize( HMONITOR hMonitor, UINT *pcxFixed, UINT *pcyMax );
void GetAvailableSize(HMONITOR hMonitor, out uint pcxFixed, out uint pcyMax);
/// <summary>Docks the specified window handle to the specified monitor handle.</summary>
/// <param name="hwnd">The accessibility application window that will be docked on the passed monitor handle.</param>
/// <param name="hMonitor">The monitor on which the accessibility application window will be docked.</param>
/// <param name="cyRequested">TBD</param>
/// <param name="pCallback">The callback pointer on which the accessibility application will receive the Undock notification.</param>
/// <returns>
/// <para>This method can return one of these values.</para>
/// <list type="table">
/// <listheader>
/// <term>Return code</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>S_OK</term>
/// <term>Success.</term>
/// </item>
/// <item>
/// <term>E_INVALIDARG</term>
/// <term>The window handle or monitor handle is not valid.</term>
/// </item>
/// <item>
/// <term>E_ACCESSDENIED</term>
/// <term>The calling process is not a UIAcess accessibility application or the calling process does not own the window.</term>
/// </item>
/// <item>
/// <term>IMM_E_DOCKOCCUPIED</term>
/// <term>There is already another window occupying the docking space. Only one window can be docked at a time.</term>
/// </item>
/// <item>
/// <term>IMM_E_INSUFFICIENTHEIGHT</term>
/// <term>
/// The requested uHeight is larger than the maximum allowed docking height for the specified monitor. However, if this error
/// code is being returned, it means that this monitor does support docking, though at a height indicated by a call to the
/// GetAvailableSize method.
/// </term>
/// </item>
/// <item>
/// <term>HRESULT_FROM_WIN32(ERROR_INVALID_MONITOR_HANDLE)</term>
/// <term>The monitor specified by the monitor handle does not support docking.</term>
/// </item>
/// </list>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iaccessibilitydockingservice-dockwindow HRESULT
// DockWindow( HWND hwnd, HMONITOR hMonitor, UINT cyRequested, IAccessibilityDockingServiceCallback *pCallback );
void DockWindow(HWND hwnd, HMONITOR hMonitor, [Optional] uint cyRequested, IAccessibilityDockingServiceCallback pCallback);
/// <summary>Undocks the specified window handle if it is currently docked.</summary>
/// <param name="hwnd">TBD</param>
/// <remarks>
/// <para>This method can only be used to undock windows that belong to the calling process.</para>
/// <para>Examples</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iaccessibilitydockingservice-undockwindow HRESULT
// UndockWindow( HWND hwnd );
void UndockWindow(HWND hwnd);
}
/// <summary>Receives Acessibility Window Docking events.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iaccessibilitydockingservicecallback
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IAccessibilityDockingServiceCallback")]
[ComImport, Guid("157733FD-A592-42E5-B594-248468C5A81B"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAccessibilityDockingServiceCallback
{
/// <summary>Undocks the accessibility window so that it will not be automatically moved to its previous location.</summary>
/// <param name="undockReason">Specifies the reason why the accessibility application's window was undocked.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iaccessibilitydockingservicecallback-undocked HRESULT
// Undocked( UNDOCK_REASON undockReason );
[PreserveSig]
HRESULT Undocked(UNDOCK_REASON undockReason);
}
/// <summary>CoClass for IAccessibilityDockingService</summary>
[PInvokeData("shobjidl.h")]
[ComImport, Guid("29CE1D46-B481-4AA0-A08A-D3EBC8ACA402"), ClassInterface(ClassInterfaceType.None)]
public class AccessibilityDockingService { }
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Runtime.InteropServices;
using Vanara.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Exposes a method that can be used by an accessibility application.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iaccessibleobject
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IAccessibleObject")]
[ComImport, Guid("95A391C5-9ED4-4c28-8401-AB9E06719E11"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAccessibleObject
{
/// <summary>
/// Sets text that is retrieved by IAccessible::get_accName which accessibility tools use to obtain the Name Property of an object.
/// </summary>
/// <param name="pszName">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a null-terminated, Unicode string containing the name.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iaccessibleobject-setaccessiblename HRESULT
// SetAccessibleName( LPCWSTR pszName );
[PreserveSig]
HRESULT SetAccessibleName([MarshalAs(UnmanagedType.LPWStr)] string pszName);
}
}
}

View File

@ -0,0 +1,54 @@
using System;
using System.Runtime.InteropServices;
using Vanara.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>
/// Exposes methods that allow clients to reset or query the display state of the autocomplete drop-down list, which contains
/// possible completions to a string entered by the user in an edit control.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iautocompletedropdown
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IAutoCompleteDropDown")]
[ComImport, Guid("3CD141F4-3C6A-11d2-BCAA-00C04FD929DB"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAutoCompleteDropDown
{
/// <summary>Gets the current display status of the autocomplete drop-down list.</summary>
/// <param name="pdwFlags">
/// <para>Type: <c>DWORD*</c></para>
/// <para>
/// A pointer to a value indicating whether the autocomplete drop-down list is currently displayed. This parameter can be
/// <c>NULL</c> on entry if this information is not needed. The following values are recognized as the target of this pointer.
/// </para>
/// <para>(0x0000)</para>
/// <para>The list is not visible.</para>
/// <para>ACDD_VISIBLE (0x0001)</para>
/// <para>The list is visible.</para>
/// </param>
/// <param name="ppwszString">
/// <para>Type: <c>LPWSTR*</c></para>
/// <para>
/// A pointer to a buffer containing the first select item in the drop-down list, if the value pointed to by pdwFlags is
/// <c>ACDD_VISIBLE</c>. This value can be <c>NULL</c> on entry if this information is not needed.
/// </para>
/// <para>If pdwFlags is zero on exit, then this value will be <c>NULL</c>.</para>
/// <para>
/// If this value is not <c>NULL</c> on exit, the buffer it points to must be freed using CoTaskMemFree when it is no longer needed.
/// </para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iautocompletedropdown-getdropdownstatus HRESULT
// GetDropDownStatus( DWORD *pdwFlags, LPWSTR *ppwszString );
void GetDropDownStatus(ref uint pdwFlags, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoTaskMemStringMarshaler))] out string ppwszString);
/// <summary>Forces the autocomplete object to refresh its list of suggestions when the list is visible.</summary>
/// <remarks>
/// The drop-down list is always rebuilt before it is displayed, so there is no reason to use this method unless the drop-down
/// list is currently visible.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iautocompletedropdown-resetenumerator HRESULT ResetEnumerator();
void ResetEnumerator();
}
}
}

View File

@ -0,0 +1,134 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>One of the following values indicating the supported type.</summary>
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.ICDBurnExt")]
[Flags]
public enum CDBE_ACTIONS : uint
{
/// <summary>
/// 0x00000001. Music files are supported. The CD writing extension is invoked for the <c>Copy to audio CD</c> task in the My
/// Music folder.
/// </summary>
CDBE_TYPE_MUSIC = 0x1,
/// <summary>0x00000002. Data files are supported. The CD writing extension is excluded from <c>Copy to audio CD</c>.</summary>
CDBE_TYPE_DATA = 0x2,
/// <summary>
/// (int)0xFFFFFFFF. All files are supported. The CD writing extension is invoked for the <c>Copy to audio CD</c> task in the My
/// Music folder.
/// </summary>
CDBE_TYPE_ALL = 0xffffffff
}
/// <summary>
/// Exposes methods that determine whether a system has hardware for writing to CD, the drive letter of a CD writer device, and
/// programmatically initiate a CD writing session.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-icdburn
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.ICDBurn")]
[ComImport, Guid("3d73a659-e5d0-4d42-afc0-5121ba425c8d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(CDBurn))]
public interface ICDBurn
{
/// <summary>Gets the drive letter of a CD drive that has been marked as write-enabled.</summary>
/// <param name="pszDrive">
/// <para>Type: <c>LPWSTR</c></para>
/// <para>A pointer to a string containing the drive letter, for example "F:".</para>
/// </param>
/// <param name="cch">
/// <para>Type: <c>UINT</c></para>
/// <para>
/// The size of the string, in characters, pointed to by pszDrive. This value will normally be 4. Values larger than 4 are
/// allowed, but the extra characters will be ignored by this method. Values less than 4 will generate an E_INVALIDARG error.
/// </para>
/// </param>
/// <remarks>
/// <para>
/// The drive whose letter designation is returned by this method is the drive that has the <c>Enable cd writing on this
/// drive</c> option selected. This option is found on the drive's property sheet. Only one drive on a system can have this
/// option selected.
/// </para>
/// <para>If a recordable CD drive is present but that option has been deselected, the method will return an error code.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-icdburn-getrecorderdriveletter HRESULT
// GetRecorderDriveLetter( LPWSTR pszDrive, UINT cch );
void GetRecorderDriveLetter([MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDrive, uint cch);
/// <summary>Instructs data to be copied from the staging area to a writable CD.</summary>
/// <param name="hwnd">
/// <para>Type: <c>HWND</c></para>
/// <para>The handle of the parent window of the UI.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// The staging area has a default location of %userprofile%\Local Settings\Application Data\Microsoft\CD Burning. Its actual
/// path can be retrieved through SHGetFolderPath, SHGetSpecialFolderPath, SHGetFolderLocation, SHGetSpecialFolderLocation, or
/// SHGetFolderPathAndSubDir by using the CSIDL_CDBURN_AREA value.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-icdburn-burn HRESULT Burn( HWND hwnd );
void Burn(HWND hwnd);
/// <summary>Scans the system for a CD drive with write-capability, returning <c>TRUE</c> if one is found.</summary>
/// <returns>
/// <para>Type: <c>BOOL*</c></para>
/// <para>A pointer to a Boolean value containing <c>TRUE</c> if a suitable device is located, <c>FALSE</c> otherwise.</para>
/// </returns>
/// <remarks>
/// This search does not rely on the state of the <c>Enable cd writing on this drive</c> option found on the drive's property
/// sheet. Instead, the determination is based on IMAPI.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-icdburn-hasrecordabledrive HRESULT
// HasRecordableDrive( BOOL *pfHasRecorder );
[return: MarshalAs(UnmanagedType.Bool)]
bool HasRecordableDrive();
}
/// <summary>
/// <para>
/// [ <c>ICDBurnExt</c> is available for use in the operating systems specified in the Requirements section. It may be altered or
/// unavailable in subsequent versions.]
/// </para>
/// <para>Exposes a single method that determines content types supported by a CD writing extension.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-icdburnext
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.ICDBurnExt")]
[ComImport, Guid("2271dcca-74fc-4414-8fb7-c56b05ace2d7"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ICDBurnExt
{
/// <summary>Determines the supported data type for a CD writing extension.</summary>
/// <returns>
/// <para>Type: <c>CDBE_ACTIONS*</c></para>
/// <para>One of the following values indicating the supported type.</para>
/// <para>CDBE_TYPE_MUSIC (0x00000001)</para>
/// <para>
/// 0x00000001. Music files are supported. The CD writing extension is invoked for the <c>Copy to audio CD</c> task in the My
/// Music folder.
/// </para>
/// <para>CDBE_TYPE_DATA (0x00000002)</para>
/// <para>0x00000002. Data files are supported. The CD writing extension is excluded from <c>Copy to audio CD</c>.</para>
/// <para>CDBE_TYPE_ALL ((int)0xFFFFFFFF)</para>
/// <para>
/// (int)0xFFFFFFFF. All files are supported. The CD writing extension is invoked for the <c>Copy to audio CD</c> task in the My
/// Music folder.
/// </para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-icdburnext-getsupportedactiontypes HRESULT
// GetSupportedActionTypes( CDBE_ACTIONS *pdwActions );
CDBE_ACTIONS GetSupportedActionTypes();
}
/// <summary>CoClass for ICDBurn</summary>
[PInvokeData("shobjidl.h")]
[ComImport, Guid("fbeb8a05-beee-4442-804e-409d6c4515e9"), ClassInterface(ClassInterfaceType.None)]
public class CDBurn { }
}
}

View File

@ -0,0 +1,306 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>The flags that determine the characteristics of a drag-and-drop operation over an IDragSourceHelper object.</summary>
[PInvokeData("shobjidl.h", MSDNShortId = "NF:shobjidl.IDragSourceHelper2.SetFlags")]
[Flags]
public enum DSH_FLAGS
{
/// <summary>
/// Allow text specified in DROPDESCRIPTION to be displayed on the drag image. If you pass this flag into the dwFlags parameter
/// of <c>IDragSourceHelper2::SetFlags</c>, then the text description is rendered on top of the supplied drag image. If you pass
/// a drag image into an IDragSourceHelper object, then by default, the extra text description of the drag-and-drop operation is
/// not displayed.
/// </summary>
DSH_ALLOWDROPDESCRIPTIONTEXT = 0x1
}
/// <summary>
/// Exposed by the Shell to allow an application to specify the image that will be displayed during a Shell drag-and-drop operation.
/// </summary>
/// <remarks>
/// <para>This interface is exposed by the Shell's drag-image manager. It is not implemented by applications.</para>
/// <para>
/// Use this interface to specify the image displayed during a Shell drag-and-drop operation. The <c>IDragSourceHelper</c>,
/// IDropTargetHelper, and IInitializeWithWindow interfaces are exposed by the drag-image manager object to allow the IDropTarget
/// interface to use custom drag images. To use either of these interfaces, you must create an in-process server drag-image manager
/// object by calling CoCreateInstance with a class identifier (CLSID) of CLSID_DragDropHelper. Get interface pointers using
/// standard Component Object Model (COM) procedures.
/// </para>
/// <para>The <c>IDragSourceHelper</c> interface provides the following two ways to specify the bitmap to be used as a drag image.</para>
/// <list type="bullet">
/// <item>
/// <term>
/// Controls that have a window can register a DI_GETDRAGIMAGE window message for it and initialize the drag-image manager with
/// IDragSourceHelper::InitializeFromWindow. When the DI_GETDRAGIMAGE message is received, the handler puts the drag image bitmap
/// information in the SHDRAGIMAGE structure that is passed as the message's lParam value.
/// </term>
/// </item>
/// <item>
/// <term>
/// Windowless controls can initialize the drag-image manager with IDragSourceHelper::InitializeFromBitmap. This method allows an
/// application to simply specify the bitmap.
/// </term>
/// </item>
/// </list>
/// <para>
/// <c>Note</c> The drag-and-drop helper object calls IDataObject::SetData to load private formats—used for cross-process
/// support—into the data object. It later retrieves these formats by calling IDataObject::GetData. To support the drag-and-drop
/// helper object, the data object's <c>SetData</c> and <c>GetData</c> implementations must be able to accept and return arbitrary
/// private formats.
/// </para>
/// <para>For further discussion of Shell drag-and-drop operations, see Transferring Shell Data Using Drag-and-Drop or the Clipboard.</para>
/// <para><c>Note</c> Prior to Windows Vista this interface was declared in Shlobj.h.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idragsourcehelper
[PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.IDragSourceHelper")]
[ComImport, Guid("DE5BF786-477A-11D2-839D-00C04FD918D0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDragSourceHelper
{
/// <summary>Initializes the drag-image manager for a windowless control.</summary>
/// <param name="pshdi">
/// <para>Type: <c>LPSHDRAGIMAGE</c></para>
/// <para>The SHDRAGIMAGE structure that contains information about the bitmap.</para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>A pointer to the data object's IDataObject interface.</para>
/// </param>
/// <remarks>
/// Because <c>InitializeFromBitmap</c> always performs the RGB multiplication step in calculating the alpha value, you should
/// always pass a bitmap without premultiplied alpha blending. Note that no error will result from passing the method a bitmap
/// with premultiplied alpha blending, but this method will multiply it again, doubling the resulting alpha value.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefrombitmap
// HRESULT InitializeFromBitmap( LPSHDRAGIMAGE pshdi, IDataObject *pDataObject );
void InitializeFromBitmap(in SHDRAGIMAGE pshdi, [In] IDataObject pDataObject);
/// <summary>Initializes the drag-image manager for a control with a window.</summary>
/// <param name="hwnd">
/// <para>Type: <c>HWND</c></para>
/// <para>A handle to the window that receives the <c>DI_GETDRAGIMAGE</c> message. This value can be <c>NULL</c>.</para>
/// </param>
/// <param name="ppt">
/// <para>Type: <c>POINT*</c></para>
/// <para>
/// A pointer to a POINT structure that specifies the location of the cursor within the drag image. The structure should contain
/// the offset from the upper-left corner of the drag image to the location of the cursor. This value can be <c>NULL</c>.
/// </para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>A pointer to the data object's IDataObject interface.</para>
/// </param>
/// <remarks>
/// The <c>DI_GETDRAGIMAGE</c> message allows you to source a drag image from a custom control. It is defined in Shlobj.h and
/// must be registered with RegisterWindowMessage. When the window specified by hwnd receives the <c>DI_GETDRAGIMAGE</c>
/// message, the lParam value holds a pointer to an SHDRAGIMAGE structure. The handler should fill the structure with the drag
/// image bitmap information.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefromwindow
// HRESULT InitializeFromWindow( HWND hwnd, POINT *ppt, IDataObject *pDataObject );
void InitializeFromWindow([In, Optional] HWND hwnd, [In, Optional] IntPtr ppt, [In] IDataObject pDataObject);
}
/// <summary>
/// Exposes a method that adds functionality to IDragSourceHelper. This method sets the characteristics of a drag-and-drop operation
/// over an <c>IDragSourceHelper</c> object.
/// </summary>
/// <remarks>
/// <para>This interface also provides the methods of the IDragSourceHelper interface, from which it inherits.</para>
/// <para>
/// If you want to adjust the behavior of the drag image by calling IDragSourceHelper2::SetFlags, that call should be made before
/// you call InitializeFromWindow or InitializeFromBitmap.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-idragsourcehelper2
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IDragSourceHelper2")]
[ComImport, Guid("83E07D0D-0C5F-4163-BF1A-60B274051E40"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDragSourceHelper2 : IDragSourceHelper
{
/// <summary>Initializes the drag-image manager for a windowless control.</summary>
/// <param name="pshdi">
/// <para>Type: <c>LPSHDRAGIMAGE</c></para>
/// <para>The SHDRAGIMAGE structure that contains information about the bitmap.</para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>A pointer to the data object's IDataObject interface.</para>
/// </param>
/// <remarks>
/// Because <c>InitializeFromBitmap</c> always performs the RGB multiplication step in calculating the alpha value, you should
/// always pass a bitmap without premultiplied alpha blending. Note that no error will result from passing the method a bitmap
/// with premultiplied alpha blending, but this method will multiply it again, doubling the resulting alpha value.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefrombitmap
// HRESULT InitializeFromBitmap( LPSHDRAGIMAGE pshdi, IDataObject *pDataObject );
new void InitializeFromBitmap(in SHDRAGIMAGE pshdi, [In] IDataObject pDataObject);
/// <summary>Initializes the drag-image manager for a control with a window.</summary>
/// <param name="hwnd">
/// <para>Type: <c>HWND</c></para>
/// <para>A handle to the window that receives the <c>DI_GETDRAGIMAGE</c> message. This value can be <c>NULL</c>.</para>
/// </param>
/// <param name="ppt">
/// <para>Type: <c>POINT*</c></para>
/// <para>
/// A pointer to a POINT structure that specifies the location of the cursor within the drag image. The structure should contain
/// the offset from the upper-left corner of the drag image to the location of the cursor. This value can be <c>NULL</c>.
/// </para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>A pointer to the data object's IDataObject interface.</para>
/// </param>
/// <remarks>
/// The <c>DI_GETDRAGIMAGE</c> message allows you to source a drag image from a custom control. It is defined in Shlobj.h and
/// must be registered with RegisterWindowMessage. When the window specified by hwnd receives the <c>DI_GETDRAGIMAGE</c>
/// message, the lParam value holds a pointer to an SHDRAGIMAGE structure. The handler should fill the structure with the drag
/// image bitmap information.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idragsourcehelper-initializefromwindow
// HRESULT InitializeFromWindow( HWND hwnd, POINT *ppt, IDataObject *pDataObject );
new void InitializeFromWindow([In, Optional] HWND hwnd, [In, Optional] IntPtr ppt, [In] IDataObject pDataObject);
/// <summary>Sets the characteristics of a drag-and-drop operation over an IDragSourceHelper object.</summary>
/// <param name="dwFlags">
/// <para>Type: <c>DWORD</c></para>
/// <para>The flags that determine the characteristics of a drag-and-drop operation over an IDragSourceHelper object.</para>
/// <para>DSH_ALLOWDROPDESCRIPTIONTEXT (0x0001)</para>
/// <para>
/// Allow text specified in DROPDESCRIPTION to be displayed on the drag image. If you pass this flag into the dwFlags parameter
/// of <c>IDragSourceHelper2::SetFlags</c>, then the text description is rendered on top of the supplied drag image. If you pass
/// a drag image into an IDragSourceHelper object, then by default, the extra text description of the drag-and-drop operation is
/// not displayed.
/// </para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-idragsourcehelper2-setflags HRESULT SetFlags( DWORD
// dwFlags );
void SetFlags([In] DSH_FLAGS dwFlags);
}
/// <summary>Exposes methods that allow drop targets to display a drag image while the image is over the target window.</summary>
/// <remarks>
/// <para>This interface is exposed by the Shell's drag-image manager. It is not implemented by applications.</para>
/// <para>
/// This interface is used by drop targets to enable the drag-image manager to display the drag image while the image is over the
/// target window. The IDragSourceHelper and <c>IDropTargetHelper</c> interfaces are exposed by the drag-image manager object to
/// allow the IDropTarget interface to use custom drag images. To use either of these interfaces, you must create an in-process
/// server drag-image manager object by calling CoCreateInstance with a class identifier (CLSID) of CLSID_DragDropHelper. Get
/// interface pointers using standard Component Object Model (COM) procedures.
/// </para>
/// <para>
/// Four of the <c>IDropTargetHelper</c> methods correspond to the four IDropTarget methods. When you implement <c>IDropTarget</c>,
/// each of its methods should call the corresponding <c>IDropTargetHelper</c> method to pass the information to the drag-image
/// manager. The fifth <c>IDropTargetHelper</c> method notifies the drag-image manager to show or hide the drag image. This method
/// is used when dragging over a target window in a low color-depth video mode. It allows the target to hide the drag image while it
/// is painting the window.
/// </para>
/// <para>
/// <c>Note</c> The drag-and-drop helper object calls IDataObject::SetData to load private formats—used for cross-process
/// support—into the data object. It later retrieves these formats by calling IDataObject::GetData. To support the drag-and-drop
/// helper object, the data object's <c>SetData</c> and <c>GetData</c> implementations must be able to accept and return arbitrary
/// private formats.
/// </para>
/// <para>For further discussion of Shell drag-and-drop operations, see Transferring Shell Data Using Drag-and-Drop or the Clipboard.</para>
/// <para><c>Note</c> Prior to Windows Vista this interface was declared in Shlobj.h.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idroptargethelper
[PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.IDropTargetHelper")]
[ComImport, Guid("4657278B-411B-11D2-839A-00C04FD918D0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDropTargetHelper
{
/// <summary>Notifies the drag-image manager that the drop target's IDropTarget::DragEnter method has been called.</summary>
/// <param name="hwndTarget">
/// <para>Type: <c>HWND</c></para>
/// <para>The target's window handle.</para>
/// </param>
/// <param name="pDataObject">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>A pointer to the data object's IDataObject interface.</para>
/// </param>
/// <param name="ppt">
/// <para>Type: <c>POINT*</c></para>
/// <para>The POINT structure pointer that was received in the IDropTarget::DragEnter method's pt parameter.</para>
/// </param>
/// <param name="dwEffect">
/// <para>Type: <c>DWORD</c></para>
/// <para>The value pointed to by the IDropTarget::DragEnter method's pdwEffect parameter.</para>
/// </param>
/// <remarks>
/// This method is called by a drop target when its IDropTarget::DragEnter method is called. It notifies the drag-image manager
/// that the drop target has been entered, and provides it with the information needed to display the drag image.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idroptargethelper-dragenter HRESULT
// DragEnter( HWND hwndTarget, IDataObject *pDataObject, POINT *ppt, DWORD dwEffect );
void DragEnter([In] HWND hwndTarget, [In] IDataObject pDataObject, in Point ppt, [In] Ole32.DROPEFFECT dwEffect);
/// <summary>Notifies the drag-image manager that the drop target's IDropTarget::DragLeave method has been called.</summary>
/// <remarks>
/// This method is called by a drop target when its IDropTarget::DragLeave method is called. It notifies the drag-image manager
/// that the cursor has left the drop target.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idroptargethelper-dragleave HRESULT DragLeave();
void DragLeave();
/// <summary>Notifies the drag-image manager that the drop target's IDropTarget::DragOver method has been called.</summary>
/// <param name="ppt">
/// <para>Type: <c>POINT*</c></para>
/// <para>The POINT structure pointer that was received in the IDropTarget::DragOver method's pt parameter.</para>
/// </param>
/// <param name="dwEffect">
/// <para>Type: <c>DWORD</c></para>
/// <para>The value pointed to by the IDropTarget::DragOver method's pdwEffect parameter.</para>
/// </param>
/// <remarks>
/// This method is called by a drop target when its IDropTarget::DragOver method is called. It notifies the drag-image manager
/// that the cursor position has changed and provides it with the information needed to display the drag image.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idroptargethelper-dragover HRESULT
// DragOver( POINT *ppt, DWORD dwEffect );
void DragOver(in Point ppt, [In] Ole32.DROPEFFECT dwEffect);
/// <summary>Notifies the drag-image manager that the drop target's IDropTarget::Drop method has been called.</summary>
/// <param name="pDataObject">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>A pointer to the data object's IDataObject interface.</para>
/// </param>
/// <param name="ppt">
/// <para>Type: <c>POINT*</c></para>
/// <para>A POINT structure pointer that was received in the IDropTarget::Drop method's pt parameter.</para>
/// </param>
/// <param name="dwEffect">
/// <para>Type: <c>DWORD</c></para>
/// <para>The value pointed to by the IDropTarget::Drop method's pdwEffect parameter.</para>
/// </param>
/// <remarks>
/// This method is called by a drop target when its IDropTarget::Drop method is called. It notifies the drag-image manager that
/// the object has been dropped, and provides it with the information needed to display the drag image.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idroptargethelper-drop HRESULT Drop(
// IDataObject *pDataObject, POINT *ppt, DWORD dwEffect );
void Drop([In] IDataObject pDataObject, in Point ppt, Ole32.DROPEFFECT dwEffect);
/// <summary>Notifies the drag-image manager to show or hide the drag image.</summary>
/// <param name="fShow">
/// <para>Type: <c>BOOL</c></para>
/// <para>A boolean value that is set to <c>TRUE</c> to show the drag image, and <c>FALSE</c> to hide it.</para>
/// </param>
/// <remarks>
/// This method is used when dragging over a target window in a low color-depth video mode. It allows the target to notify the
/// drag-image manager to hide the drag image while it is painting the window. While you are painting a window that is currently
/// being dragged over, hide the drag image by calling <c>Show</c> with fShow set to <c>FALSE</c>. Once the window has been
/// painted, display the drag image again by calling <c>Show</c> with fShow set to <c>TRUE</c>.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-idroptargethelper-show HRESULT Show( BOOL
// fShow );
void Show([MarshalAs(UnmanagedType.Bool)] bool fShow);
}
}
}

View File

@ -0,0 +1,89 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>
/// Exposes methods that enumerate the contents of a view and receive notification from callback upon enumeration completion. This
/// interface enables clients of a view to attempt to share the view's list of folder contents.
/// </summary>
/// <remarks>
/// <para>
/// IFolderView (a folder view) supports presentation of the contents of a folder, and exposes the <c>IEnumerableView</c> through
/// QueryService on service request SID_EnumerableView. <c>IEnumerableView</c> offers enhanced performance compared to obtaining the
/// contents of the folder directly from the folder using IEnumIDList (call IShellFolder::EnumObjects to return this interface).
/// Since the view asked for the contents of the folder in order to display those contents, using <c>IEnumerableView</c> enables a
/// client to get a copy of the work already done by <c>IFolderView</c>.
/// </para>
/// <para>
/// Typicallly, this enumeration service is compatible with most folders, and is only provided if it is safe to enumerate the
/// contents of the view. For example, using this service with a folder containing search results is not supported.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ienumerableview
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IEnumerableView")]
[ComImport, Guid("8C8BF236-1AEC-495f-9894-91D57C3C686F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumerableView
{
/// <summary>Sets a callback on the view that is notified when the initial view enumeration is complete.</summary>
/// <param name="percb">
/// <para>Type: <c>IEnumReadyCallback*</c></para>
/// <para>A pointer to the IEnumReadyCallback interface.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>Returns a success value if successful, or an error value otherwise.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ienumerableview-setenumreadycallback HRESULT
// SetEnumReadyCallback( IEnumReadyCallback *percb );
[PreserveSig]
HRESULT SetEnumReadyCallback([In] IEnumReadyCallback percb);
/// <summary>Creates an enumerator of ID lists from the contents of the view.</summary>
/// <param name="pidlFolder">
/// <para>Type: <c>PCIDLIST_ABSOLUTE</c></para>
/// <para>A PIDL that is relative to the Desktop.</para>
/// </param>
/// <param name="dwEnumFlags">
/// <para>Type: <c>DWORD</c></para>
/// <para>Specifies enumeration flags. See the SHCONTF enumerated type.</para>
/// </param>
/// <param name="ppEnumIDList">
/// <para>Type: <c>IEnumIDList**</c></para>
/// <para>When this method returns, contains an IEnumIDList interface pointer.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>Returns a success value if successful, or an error value otherwise.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ienumerableview-createenumidlistfromcontents HRESULT
// CreateEnumIDListFromContents( PCIDLIST_ABSOLUTE pidlFolder, DWORD dwEnumFlags, IEnumIDList **ppEnumIDList );
[PreserveSig]
HRESULT CreateEnumIDListFromContents([In] PIDL pidlFolder, SHCONTF dwEnumFlags, out IEnumIDList ppEnumIDList);
}
/// <summary>
/// Exposes methods that enable the view to notify the implementer when the enumeration has completed. The view calls this method to
/// tell the implementer that the enumeration can be retrieved via IEnumerableView::CreateEnumIDListFromContents. The callback
/// allows the implementer to share the views enumeration.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ienumreadycallback
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IEnumReadyCallback")]
[ComImport, Guid("61E00D45-8FFF-4e60-924E-6537B61612DD"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IEnumReadyCallback
{
/// <summary>
/// Notifies the implementer that the view's item enumeration has completed. This callback interface is provided to the view via SetEnumReadyCallback
/// </summary>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ienumreadycallback-enumready HRESULT EnumReady();
[PreserveSig]
HRESULT EnumReady();
}
}
}

View File

@ -28,7 +28,7 @@ namespace Vanara.PInvoke
/// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nn-shobjidl_core-iexecutecommand
[PInvokeData("shobjidl_core.h", MSDNShortId = "a3432f1a-dd33-4e0d-8b26-1312bb5151f7")]
[ComImport, Guid("7F9185B0-CB92-43c5-80A9-92277A4F7B54"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[ComImport, Guid("7F9185B0-CB92-43c5-80A9-92277A4F7B54"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(ExecuteFolder))]
public interface IExecuteCommand
{
/// <summary>Sets a value based on the current state of the keys CTRL and SHIFT.</summary>
@ -223,5 +223,10 @@ namespace Vanara.PInvoke
[PreserveSig]
HRESULT Initialize([In, MarshalAs(UnmanagedType.LPWStr)] string pszCommandName, [In] IPropertyBag ppb);
}
/// <summary>CoClass for IExecuteCommand</summary>
[PInvokeData("shobjidl.h")]
[ComImport, Guid("11dbb47c-a525-400b-9e80-a54615a090c0"), ClassInterface(ClassInterfaceType.None)]
public class ExecuteFolder { }
}
}

View File

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using static Vanara.PInvoke.Ole32;
namespace Vanara.PInvoke
@ -864,6 +865,30 @@ namespace Vanara.PInvoke
void DoRename();
}
/// <summary>Exposes a method that hosts an IFolderView object in a window.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ifolderviewhost
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IFolderViewHost")]
[ComImport, Guid("1ea58f02-d55a-411d-b09e-9e65ac21605b"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(FolderViewHost))]
public interface IFolderViewHost
{
/// <summary>Initializes the object that hosts an IFolderView object.</summary>
/// <param name="hwndParent">
/// <para>Type: <c>HWND</c></para>
/// <para>The handle of the window that contains the IFolderViewHost object.</para>
/// </param>
/// <param name="pdo">
/// <para>Type: <c>IDataObject*</c></para>
/// <para>The address of a pointer to a data object.</para>
/// </param>
/// <param name="prc">
/// <para>Type: <c>RECT*</c></para>
/// <para>The address of a pointer to a <c>RECT</c> structure that specifies the dimensions of the folder view.</para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ifolderviewhost-initialize
// HRESULT Initialize( HWND hwndParent, IDataObject *pdo, RECT *prc );
void Initialize([In] HWND hwndParent, [In] IDataObject pdo, in RECT prc);
}
/// <summary>
/// <para>Exposes methods that hold items from a data object.</para>
/// <para>
@ -1054,5 +1079,10 @@ namespace Vanara.PInvoke
/// </summary>
public SORTDIRECTION direction;
}
/// <summary>CoClass for IFolderViewHost</summary>
[PInvokeData("shobjidl.h")]
[ComImport, Guid("20b1cb23-6968-4eb9-b7d4-a66d00d07cee"), ClassInterface(ClassInterfaceType.None)]
public class FolderViewHost { }
}
}

View File

@ -0,0 +1,601 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using Vanara.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>
/// Called by AutoPlay. Exposes methods that get dynamic information regarding a registered handler prior to displaying it to the user.
/// </summary>
/// <remarks>
/// <para>
/// Prior to this interface, when an application registered a handler and was displayed in the autoplay prompt, the handler was
/// always shown as long as the content type (for example, mp3 or avi) associated with that handler was found on the media device.
/// The same icon and action string were always displayed.
/// </para>
/// <para>
/// If a handler implements this interface prior to showing the handler, AutoPlay will first call IDynamicHWHandler::GetDynamicInfo
/// to determine if this handler is to be presented to the user. If you want to show the handler, you may specify a different action
/// string than the one supplied by the static handler registration under <c>HKLM</c>.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-idynamichwhandler
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IDynamicHWHandler")]
[ComImport, Guid("DC2601D7-059E-42fc-A09D-2AFD21B6D5F7"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IDynamicHWHandler
{
/// <summary>Called by the system to determine whether a particular handler will be shown before the AutoPlay dialog is displayed.</summary>
/// <param name="pszDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a string that indicates the device path or drive root.</para>
/// </param>
/// <param name="dwContentType">
/// <para>Type: <c>DWORD</c></para>
/// <para>The content type.</para>
/// </param>
/// <param name="ppszAction">
/// <para>Type: <c>LPWSTR*</c></para>
/// <para>A pointer to the new action string, or <c>NULL</c> if the default action string is to be used.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>Returns S_OK if this handler is to be displayed, S_FALSE if it is to be hidden, or an error value otherwise.</para>
/// </returns>
/// <remarks>
/// <para>
/// To register a dynamic handler, add a REG_SZ named "DynamicHWHandlerCLSID" and assign it the CLSID of your IDynamicHWHandler implementation.
/// </para>
/// <para>Example:</para>
/// <para>
/// <c>HKLM</c><c>Software</c><c>Microsoft</c><c>Windows</c><c>CurrentVersion</c><c>Explorer</c><c>AutoplayHandlers</c><c>Handlers</c><c>YourHandler</c><c>DynamicHWHandlerCLSID</c>
/// = [REG_SZ] {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-idynamichwhandler-getdynamicinfo HRESULT
// GetDynamicInfo( LPCWSTR pszDeviceID, DWORD dwContentType, LPWSTR *ppszAction );
[PreserveSig]
HRESULT GetDynamicInfo([MarshalAs(UnmanagedType.LPWStr)] string pszDeviceID, uint dwContentType, out StrPtrUni ppszAction);
}
/// <summary>Called by AutoPlay to implement the handling of registered media types.</summary>
/// <remarks>
/// <para>Developers supporting this interface must expose it in a Component Object Model (COM) server.</para>
/// <para>
/// All applications registered as AutoPlay media handlers must implement this interface. Handlers that implement this interface
/// should return quickly from calls to IHWEventHandler::HandleEvent and IHWEventHandler2::HandleEventWithHWND so they won't block
/// the AutoPlay dialog from closing. Additionally, if a local server must be launched for the creation of this handler, it should
/// not block the CreateInstance call; it should return as soon as possible.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ihweventhandler
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IHWEventHandler")]
[ComImport, Guid("C1FB73D0-EC3A-4ba2-B512-8CDB9187B6D1"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IHWEventHandler
{
/// <summary>Initializes an object that contains an implementation of the IHWEventHandler interface.</summary>
/// <param name="pszParams">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a string buffer that contains the string from the following registry value.</para>
/// <para>
/// <c>HKEY_LOCAL_MACHINE</c><c>Software</c><c>Microsoft</c><c>Windows</c><c>CurrentVersion</c><c>Explorer</c><c>AutoPlayHandlers</c><c>Handlers</c>
/// HandlerName <c>InitCmdLine</c> = string
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>This method receives the registry string stored in the InitCmdLine value under the</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler-initialize HRESULT Initialize(
// LPCWSTR pszParams );
[PreserveSig]
HRESULT Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszParams);
/// <summary>Handles AutoPlay device events for which there is no content of the type the application is registered to handle.</summary>
/// <param name="pszDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a string buffer that contains the device ID.</para>
/// </param>
/// <param name="pszAltDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string buffer that contains the alternate device ID. The alternate device ID is more human-readable than the
/// primary device ID.
/// </para>
/// </param>
/// <param name="pszEventType">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string buffer that contains the event type. The event types include DeviceArrival, DeviceRemoval,
/// MediaArrival, and MediaRemoval.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>The event types are not C/C++ language constants; they are literal text strings.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler-handleevent HRESULT HandleEvent(
// LPCWSTR pszDeviceID, LPCWSTR pszAltDeviceID, LPCWSTR pszEventType );
[PreserveSig]
HRESULT HandleEvent([MarshalAs(UnmanagedType.LPWStr)] string pszDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszAltDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszEventType);
/// <summary>Not implemented.</summary>
/// <param name="pszDeviceID">This parameter is unused.</param>
/// <param name="pszAltDeviceID">This parameter is unused.</param>
/// <param name="pszEventType">This parameter is unused.</param>
/// <param name="pszContentTypeHandler">This parameter is unused.</param>
/// <param name="pdataobject">This parameter is unused.</param>
/// <returns>This method does not return a value.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler-handleeventwithcontent HRESULT
// HandleEventWithContent( LPCWSTR pszDeviceID, LPCWSTR pszAltDeviceID, LPCWSTR pszEventType, LPCWSTR pszContentTypeHandler,
// IDataObject *pdataobject );
[PreserveSig]
HRESULT HandleEventWithContent([MarshalAs(UnmanagedType.LPWStr)] string pszDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszAltDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszEventType,
[MarshalAs(UnmanagedType.LPWStr)] string pszContentTypeHandler,
IDataObject pdataobject);
}
/// <summary>Extends the IHWEventHandler interface to address User Account Control (UAC) elevation for device handlers.</summary>
/// <remarks>
/// <para>This interface also provides the methods of the IHWEventHandler interface, from which it inherits.</para>
/// <para>
/// Handlers that implement this interface should return quickly from calls to IHWEventHandler::HandleEvent and
/// IHWEventHandler2::HandleEventWithHWND so they do not block the AutoPlay dialog from closing. Also, if a local server must be
/// launched for the creation of this handler, it should not block the CreateInstance call; it should return as soon as possible.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ihweventhandler2
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IHWEventHandler2")]
[ComImport, Guid("CFCC809F-295D-42e8-9FFC-424B33C487E6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IHWEventHandler2 : IHWEventHandler
{
/// <summary>Initializes an object that contains an implementation of the IHWEventHandler interface.</summary>
/// <param name="pszParams">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a string buffer that contains the string from the following registry value.</para>
/// <para>
/// <c>HKEY_LOCAL_MACHINE</c><c>Software</c><c>Microsoft</c><c>Windows</c><c>CurrentVersion</c><c>Explorer</c><c>AutoPlayHandlers</c><c>Handlers</c>
/// HandlerName <c>InitCmdLine</c> = string
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>This method receives the registry string stored in the InitCmdLine value under the</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler-initialize HRESULT Initialize(
// LPCWSTR pszParams );
[PreserveSig]
new HRESULT Initialize([MarshalAs(UnmanagedType.LPWStr)] string pszParams);
/// <summary>Handles AutoPlay device events for which there is no content of the type the application is registered to handle.</summary>
/// <param name="pszDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a string buffer that contains the device ID.</para>
/// </param>
/// <param name="pszAltDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string buffer that contains the alternate device ID. The alternate device ID is more human-readable than the
/// primary device ID.
/// </para>
/// </param>
/// <param name="pszEventType">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string buffer that contains the event type. The event types include DeviceArrival, DeviceRemoval,
/// MediaArrival, and MediaRemoval.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>The event types are not C/C++ language constants; they are literal text strings.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler-handleevent HRESULT HandleEvent(
// LPCWSTR pszDeviceID, LPCWSTR pszAltDeviceID, LPCWSTR pszEventType );
[PreserveSig]
new HRESULT HandleEvent([MarshalAs(UnmanagedType.LPWStr)] string pszDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszAltDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszEventType);
/// <summary>Not implemented.</summary>
/// <param name="pszDeviceID">This parameter is unused.</param>
/// <param name="pszAltDeviceID">This parameter is unused.</param>
/// <param name="pszEventType">This parameter is unused.</param>
/// <param name="pszContentTypeHandler">This parameter is unused.</param>
/// <param name="pdataobject">This parameter is unused.</param>
/// <returns>This method does not return a value.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler-handleeventwithcontent HRESULT
// HandleEventWithContent( LPCWSTR pszDeviceID, LPCWSTR pszAltDeviceID, LPCWSTR pszEventType, LPCWSTR pszContentTypeHandler,
// IDataObject *pdataobject );
[PreserveSig]
new HRESULT HandleEventWithContent([MarshalAs(UnmanagedType.LPWStr)] string pszDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszAltDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszEventType,
[MarshalAs(UnmanagedType.LPWStr)] string pszContentTypeHandler,
IDataObject pdataobject);
/// <summary>
/// Handles AutoPlay device events that contain content types that the application is not registered to handle. This method
/// provides a handle to the owner window so that UI can be displayed if the process requires elevated privileges.
/// </summary>
/// <param name="pszDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a string buffer that contains the device ID.</para>
/// </param>
/// <param name="pszAltDeviceID">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string buffer that contains the alternate device ID. The alternate device ID is more human-readable than the
/// primary device ID.
/// </para>
/// </param>
/// <param name="pszEventType">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string buffer that contains the event type. The event types include DeviceArrival, DeviceRemoval,
/// MediaArrival, and MediaRemoval.
/// </para>
/// </param>
/// <param name="hwndOwner">
/// <para>Type: <c>HWND</c></para>
/// <para>A handle to the AutoPlay dialog that was displayed.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// <para>
/// When a handler is invoked and requires immediate privilege elevation in a new process, it requires an active parent window
/// handle to display its consent UI. IHWEventHandler::HandleEvent cannot give a handle, so only a blinking taskbar appears.
/// <c>IHWEventHandler2::HandleEventWithHWND</c> provides the HWND and enables the UI to be displayed.
/// </para>
/// <para>
/// Note that if the handler was launched by default instead of by direct user action, the HWND is not active and the dialog is
/// not shown in the foreground.
/// </para>
/// <para>The event types are not C/C++ language constants; they are literal text strings.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ihweventhandler2-handleeventwithhwnd HRESULT
// HandleEventWithHWND( LPCWSTR pszDeviceID, LPCWSTR pszAltDeviceID, LPCWSTR pszEventType, HWND hwndOwner );
[PreserveSig]
HRESULT HandleEventWithHWND([MarshalAs(UnmanagedType.LPWStr)] string pszDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszAltDeviceID,
[MarshalAs(UnmanagedType.LPWStr)] string pszEventType,
HWND hwndOwner);
}
/// <summary>
/// Exposes a method that programmatically overrides AutoPlay or AutoRun. This allows you to customize the location and type of
/// content that is launched when media is inserted.
/// </summary>
/// <remarks>
/// <para>
/// <c>Note</c><c>IQueryCancelAutoPlay</c> is intended only for use by user-launched applications that are currently running. It
/// should not be handled by invisible or background service applications to prevent the normal AutoPlay/AutoRun feature from being
/// invoked. Giving the user a choice of what happens when media and devices are inserted into the system is a key feature of the
/// platform. This feature is designed specifically to improve and personalize the user experience and should not be inhibited by
/// background services.
/// </para>
/// <para>
/// A valid use of <c>IQueryCancelAutoPlay</c> is illustrated in the following scenario: Assume that you have, through AutoPlay,
/// previously designated application A to handle video camera events. For video editing, however, you prefer application B. You
/// open application B, begin editing some previously filmed video, and then decide to add some new content to the video being
/// edited. Application B's import function prompts you to turn on the video camera so that the new content can be accessed.
/// Normally, this video device activation would trigger the launch of the device-associated application A. Fortunately, using
/// <c>IQueryCancelAutoPlay</c>, application B has canceled AutoPlay processing of video camera events while you are editing video
/// content. In this case, the cancellation of Autoplay by application B has created a better user experience.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iquerycancelautoplay
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IQueryCancelAutoPlay")]
[ComImport, Guid("DDEFE873-6997-4e68-BE26-39B633ADBE12"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IQueryCancelAutoPlay
{
[PreserveSig]
HRESULT AllowAutoPlay([MarshalAs(UnmanagedType.LPWStr)] string pszPath, uint dwContentType, [MarshalAs(UnmanagedType.LPWStr)] string pszLabel, uint dwSerialNumber);
}
/// <summary>
/// Exposes a method that provides a simple, standard mechanism for objects to query a client for permission to continue an
/// operation. Clients of IUserNotification, for example, must pass an implementation of <c>IQueryContinue</c> to the
/// IUserNotification::Show method.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-iquerycontinue
[PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.IQueryContinue")]
[ComImport, Guid("7307055c-b24a-486b-9f25-163e597a28a9"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IQueryContinue
{
/// <summary>Returns <c>S_OK</c> if the operation associated with the current instance of this interface should continue.</summary>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>Returns <c>S_OK</c> if the calling application should continue, <c>S_FALSE</c> if not.</para>
/// </returns>
/// <remarks>
/// In typical usage, a pointer to an IQueryContinue interface is passed to a method of another object. That object, in turn,
/// runs this method periodically to determine whether to continue its actions. For example, if a user clicks a cancel button,
/// this method will start returning <c>S_FALSE</c>.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iquerycontinue-querycontinue HRESULT QueryContinue();
[PreserveSig]
HRESULT QueryContinue();
}
/// <summary>
/// <para>
/// Exposes methods that set notification information and then display that notification to the user in a balloon that appears in
/// conjunction with the notification area of the taskbar.
/// </para>
/// <para>
/// <c>Note</c><c>IUserNotification2</c> does not inherit from IUserNotification. <c>IUserNotification2</c> differs from
/// <c>IUserNotification</c> only in its Show method, which adds an additional parameter for a callback interface to communicate
/// with the notification. Otherwise the two interfaces are identical in form and function. CLSID_UserNotification implements both
/// versions of <c>Show</c> as an overload.
/// </para>
/// </summary>
/// <remarks>
/// <para>When to Implement</para>
/// <para>An implementation of this interface is provided in Windows as CLSID_UserNotification.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iusernotification2
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IUserNotification2")]
[ComImport, Guid("215913CC-57EB-4FAB-AB5A-E5FA7BEA2A6C"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IUserNotification2
{
/// <summary>Sets the information to be displayed in a balloon notification.</summary>
/// <param name="pszTitle">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a Unicode string that specifies the title of the notification.</para>
/// </param>
/// <param name="pszText">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a Unicode string that specifies the text to be displayed in the body of the balloon.</para>
/// </param>
/// <param name="dwInfoFlags">
/// <para>Type: <c>DWORD</c></para>
/// <para>One or more of the following values that indicate an icon to display in the notification balloon.</para>
/// <para>NIIF_NONE (0x00000000)</para>
/// <para>0x00000000. Do not display an icon.</para>
/// <para>NIIF_INFO (0x00000001)</para>
/// <para>0x00000001. Display an information icon.</para>
/// <para>NIIF_WARNING (0x00000002)</para>
/// <para>0x00000002. Display a warning icon.</para>
/// <para>NIIF_ERROR (0x00000003)</para>
/// <para>0x00000003. Display an error icon.</para>
/// <para>NIIF_USER (0x00000004)</para>
/// <para>0x00000004. <c>Windows XP SP2 and later</c>. Use the icon identified in <c>hIcon</c> in the notification balloon.</para>
/// <para>NIIF_NOSOUND (0x00000010)</para>
/// <para>
/// 0x00000010. <c>Windows XP and later</c>. Do not play the associated sound. This value applies only to balloon notifications
/// and not to standard user notifications.
/// </para>
/// <para>NIIF_LARGE_ICON (0x00000010)</para>
/// <para>
/// 0x00000010. <c>Windows Vista and later</c>. The large version of the icon should be used as the icon in the notification
/// balloon. This corresponds to the icon with dimensions SM_CXICON x SM_CYICON. If this flag is not set, the icon with
/// dimensions XM_CXSMICON x SM_CYSMICON is used.
/// </para>
/// <list type="bullet">
/// <item>
/// <term>This flag can be used with all stock icons.</term>
/// </item>
/// <item>
/// <term>
/// Applications that use older customized icons (NIIF_USER with <c>hIcon</c>) must provide a new SM_CXICON x SM_CYICON version
/// in the tray icon specified in the <c>hIcon</c> member of the NOTIFYICONDATA structure. These icons are scaled down when they
/// are displayed in the notification area.
/// </term>
/// </item>
/// <item>
/// <term>
/// New customized icons (NIIF_USER with <c>hBalloonIcon</c>) must supply an SM_CXICON x SM_CYICON version in the supplied icon
/// ( <c>hBalloonIcon</c>).
/// </term>
/// </item>
/// </list>
/// <para>NIIF_RESPECT_QUIET_TIME (0x00000080)</para>
/// <para>
/// 0x00000080. <c>Windows 7 and later</c>. Do not display the notification balloon if the current user is in "quiet time",
/// which is the first hour after a new user logs into his or her account for the first time. During this time, most
/// notifications should not be sent or shown. This lets a user become accustomed to a new computer system without those
/// distractions. Quiet time also occurs for each user after an operating system upgrade or clean installation. A notification
/// sent with this flag during quiet time is not queued; it is simply dismissed unshown. The application can resend the
/// notification later if it is still valid at that time.
/// </para>
/// <para>
/// Because an application cannot predict when it might encounter quiet time, we recommended that this flag always be set on all
/// appropriate notifications by any application that means to honor quiet time.
/// </para>
/// <para>If the current user is not in quiet time, this flag has no effect.</para>
/// <para>NIIF_ICON_MASK (0x0000000F)</para>
/// <para>0x0000000F. <c>Windows XP</c> (Shell32.dll version 6.0 <c>) and later</c>. Reserved.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotification2-setballooninfo HRESULT
// SetBalloonInfo( LPCWSTR pszTitle, LPCWSTR pszText, DWORD dwInfoFlags );
[PreserveSig]
HRESULT SetBalloonInfo([MarshalAs(UnmanagedType.LPWStr)] string pszTitle, [MarshalAs(UnmanagedType.LPWStr)] string pszText, NIIF dwInfoFlags);
/// <summary>Specifies the conditions for trying to display user information when the first attempt fails.</summary>
/// <param name="dwShowTime">
/// <para>Type: <c>DWORD</c></para>
/// <para>The amount of time, in milliseconds, to display the user information.</para>
/// </param>
/// <param name="dwInterval">
/// <para>Type: <c>DWORD</c></para>
/// <para>The interval of time, in milliseconds, between attempts to display the user information.</para>
/// </param>
/// <param name="cRetryCount">
/// <para>Type: <c>UINT</c></para>
/// <para>The number of times the system should try to display the user information.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotification2-setballoonretry HRESULT
// SetBalloonRetry( DWORD dwShowTime, DWORD dwInterval, UINT cRetryCount );
[PreserveSig]
HRESULT SetBalloonRetry(uint dwShowTime, uint dwInterval, uint cRetryCount);
/// <summary>Sets the notification area icon associated with specific user information.</summary>
/// <param name="hIcon">
/// <para>Type: <c>HICON</c></para>
/// <para>A handle to the icon.</para>
/// </param>
/// <param name="pszToolTip">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a string that contains the tooltip text to display for the specified icon. This value can be <c>NULL</c>,
/// although it is not recommended.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotification2-seticoninfo HRESULT SetIconInfo(
// HICON hIcon, LPCWSTR pszToolTip );
[PreserveSig]
HRESULT SetIconInfo(HICON hIcon, [MarshalAs(UnmanagedType.LPWStr)] string pszToolTip);
/// <summary>Displays the user information in a balloon-style tooltip.</summary>
/// <param name="pqc">
/// <para>Type: <c>IQueryContinue*</c></para>
/// <para>
/// An IQueryContinue interface pointer, used to determine whether the notification display can continue or should stop (for
/// example, if the user closes the notification). This value can be <c>NULL</c>.
/// </para>
/// </param>
/// <param name="dwContinuePollInterval">
/// <para>Type: <c>DWORD</c></para>
/// <para>The length of time, in milliseconds, to display user information.</para>
/// </param>
/// <param name="pSink">
/// <para>Type: <c>IUserNotificationCallback*</c></para>
/// <para>
/// A pointer to an IUserNotificationCallback interface, used to handle mouse click and hover actions on the notification area
/// icon and within the notification itself. This value can be <c>NULL</c>.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotification2-show HRESULT Show( IQueryContinue
// *pqc, DWORD dwContinuePollInterval, IUserNotificationCallback *pSink );
HRESULT Show(IQueryContinue pqc, uint dwContinuePollInterval, IUserNotificationCallback pSink);
/// <summary>Plays a sound in conjunction with the notification.</summary>
/// <param name="pszSoundName">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A pointer to a null-terminated Unicode string that specifies the alias of the sound file to play.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// <para>
/// The string pointed to by pszSoundName contains an alias for a system event found in the registry or the Win.ini file; for
/// instance, "SystemExit".
/// </para>
/// <para>
/// The specified sound is played asynchronously and the method returns immediately after beginning the sound. To stop an
/// asynchronous waveform sound, call <c>IUserNotification2::PlaySound</c> with pszSoundName set to <c>NULL</c>.
/// </para>
/// <para>
/// The specified sound event will yield to another sound event that is already playing. If a sound cannot be played because the
/// resource needed to play that sound is busy, the method immediately returns S_FALSE without playing the requested sound.
/// </para>
/// <para>If the specified sound cannot be found, <c>IUserNotification2::PlaySound</c> uses the system default sound.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotification2-playsound HRESULT PlaySound(
// LPCWSTR pszSoundName );
[PreserveSig]
HRESULT PlaySound([MarshalAs(UnmanagedType.LPWStr)] string pszSoundName);
}
/// <summary>
/// Exposes a method for the handling of a mouse click or shortcut menu access in a notification balloon. Used with IUserNotification2::Show.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iusernotificationcallback
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IUserNotificationCallback")]
[ComImport, Guid("19108294-0441-4AFF-8013-FA0A730B0BEA"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IUserNotificationCallback
{
/// <summary>
/// Called when the user clicks the balloon. The application may respond with an action that is suitable for the balloon being clicked.
/// </summary>
/// <param name="pt">
/// <para>Type: <c>POINT*</c></para>
/// <para>
/// Takes a pointer to the POINT structure which, upon method return, points to the position of the mouse in screen space where
/// the mouse click occurred.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotificationcallback-onballoonuserclick HRESULT
// OnBalloonUserClick( POINT *pt );
[PreserveSig]
HRESULT OnBalloonUserClick(ref Point pt);
/// <summary>
/// Called when the user clicks the icon in the notification area. The applications may launch some customary UI in response.
/// </summary>
/// <param name="pt">
/// <para>Type: <c>POINT*</c></para>
/// <para>
/// Takes a pointer to the POINT structure which, when the method returns, points to the position of the mouse in the screen
/// space where the mouse click occurred.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotificationcallback-onleftclick HRESULT
// OnLeftClick( POINT *pt );
[PreserveSig]
HRESULT OnLeftClick(ref Point pt);
/// <summary>
/// Called when the user right-clicks (or presses SHIFT+F10) the icon in the notification area. The application should show its
/// context menu in response.
/// </summary>
/// <param name="pt">
/// <para>Type: <c>POINT*</c></para>
/// <para>
/// When returned by the method, takes a pointer to the POINT structure at the position of the mouse in the screen space where
/// the click occurred.
/// </para>
/// <para>In the case where user presses SHIFT+F10, the pointer points to the center of the icon in the screen space.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iusernotificationcallback-oncontextmenu HRESULT
// OnContextMenu( POINT *pt );
[PreserveSig]
HRESULT OnContextMenu(ref Point pt);
}
}
}

View File

@ -0,0 +1,66 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using static Vanara.PInvoke.Ole32;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Exposes a method that recompress images.</summary>
/// <remarks>
/// Implement <c>IImageRecompress</c> if you are implementing an image object that may need recompressing. The
/// <c>IImageRecompress</c> interface is implemented in the ImageRecompress object.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iimagerecompress
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IImageRecompress")]
[ComImport, Guid("505f1513-6b3e-4892-a272-59f8889a4d3e"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(ImageRecompress))]
public interface IImageRecompress
{
/// <summary>
/// Recompresses an image. Implemented in an ImageRecompress object, this method accepts x and y dimensions with a designation
/// of quality. The method creates a stream containing the new image that has been recompressed to the specified size.
/// </summary>
/// <param name="psi">
/// <para>Type: <c>IShellItem*</c></para>
/// <para>A pointer to the object containing the stream of the image to read.</para>
/// </param>
/// <param name="cx">
/// <para>Type: <c>int</c></para>
/// <para>The x dimension of the image to return.</para>
/// </param>
/// <param name="cy">
/// <para>Type: <c>int</c></para>
/// <para>The y dimension of the image to return.</para>
/// </param>
/// <param name="iQuality">
/// <para>Type: <c>int</c></para>
/// <para>An indication of recompression quality that can range from 0 to 100.</para>
/// </param>
/// <param name="pstg">
/// <para>Type: <c>IStorage*</c></para>
/// <para>A pointer to an IStorage interface on the object that contains the stream to be written to.</para>
/// </param>
/// <param name="ppstrmOut">
/// <para>Type: <c>IStream**</c></para>
/// <para>The address of an IStream interface pointer variable that receives the output stream written to.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>
/// Returns S_OK if successful, or a COM-defined error code otherwise. If the image in the input stream is less than the size
/// specified by cx and cy, then S_FALSE is returned.
/// </para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iimagerecompress-recompressimage
// HRESULT RecompressImage( IShellItem *psi, int cx, int cy, int iQuality, IStorage *pstg, IStream **ppstrmOut );
[PreserveSig]
HRESULT RecompressImage(IShellItem psi, int cx, int cy, int iQuality, IStorage pstg, out IStream ppstrmOut);
}
/// <summary>CoClass for IImageRecompress</summary>
[PInvokeData("shobjidl.h")]
[ComImport, Guid("6e33091c-d2f8-4740-b55e-2e11d1477a2c"), ClassInterface(ClassInterfaceType.None)]
public class ImageRecompress { }
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using static Vanara.PInvoke.Ole32;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>
/// <para>
/// [ <c>IInsertItem</c> is available for use in the operating systems specified in the Requirements section. It may be altered or
/// unavailable in subsequent versions.]
/// </para>
/// <para>Exposes a method that inserts an ITEMIDLIST structure into a list of such structures.</para>
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iinsertitem
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IInsertItem")]
[ComImport, Guid("D2B57227-3D23-4b95-93C0-492BD454C356"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IInsertItem
{
/// <summary>Adds an ITEMIDLIST structure to a list of such structures.</summary>
/// <param name="pidl">
/// <para>Type: <c>LPCITEMIDLIST</c></para>
/// <para>A pointer to an ITEMIDLIST structure that corresponds to an item in a Shell folder.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iinsertitem-insertitem
// HRESULT InsertItem( PCUIDLIST_RELATIVE pidl );
[PreserveSig]
HRESULT InsertItem([In] PIDL pidl);
}
}
}

View File

@ -0,0 +1,95 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>
/// Exposes a method that checks for previous versions of server files or folders, stored for the purpose of reversion by the shadow
/// copies technology provided with Windows Server 2003.
/// </summary>
/// <remarks>
/// <para>The CLSID, IID, and definition for this interface are shown in the following example.</para>
/// <para>
/// Note that the shadow copies technology does not store entire copies of older versions unless they are deleted; only the changed
/// bits are stored.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ipreviousversionsinfo
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IPreviousVersionsInfo")]
[ComImport, Guid("76e54780-ad74-48e3-a695-3ba9a0aff10d"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(PreviousVersionsInfo))]
public interface IPreviousVersionsInfo
{
/// <summary>Queries for the availablilty of a Windows Server 2003 volume image recorded by the system at an earlier time.</summary>
/// <param name="pszPath">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>A null-terminated Unicode string containing the fully qualified path to a file or folder on the volume in question.</para>
/// <para><c>Note</c> Only paths to files and folders stored on a Windows Server 2003 volume are currently supported.</para>
/// </param>
/// <param name="fOkToBeSlow">
/// <para>Type: <c>BOOL</c></para>
/// <para>
/// A boolean value specifying whether a server should be contacted to determine the availability of stored volume images. For
/// more details, see the Remarks section.
/// </para>
/// <para>TRUE</para>
/// <para>Contact the server if the results are not already cached.</para>
/// <para>FALSE</para>
/// <para>Do not contact the server. Use cached results instead.</para>
/// </param>
/// <returns>
/// <para>Type: <c>BOOL*</c></para>
/// <para>
/// A pointer to a boolean variable containing the result. This value is valid only if the method call succeeds; otherwise, it
/// is undefined.
/// </para>
/// <para>TRUE</para>
/// <para>At least one stored image of the volume where the file or folder named in pszPath resides is available.</para>
/// <para>FALSE</para>
/// <para>No volume images are stored.</para>
/// </returns>
/// <remarks>
/// <para>
/// If <c>IPreviousVersionsInfo::AreSnapshotsAvailable</c> is called on a file or folder, the result does not indicate that
/// rollback information is available for that specific file or folder, merely that a snapshot of the entire volume is
/// available. This result is cached and subsequent calls inquiring about anything stored on that same volume access the cached
/// results—with little performance overhead—instead of recontacting the server.
/// </para>
/// <para>
/// Once the server's response is cached in memory, subsequent calls do not contact the server even if fOkToBeSlow is
/// <c>TRUE</c>. If fOkToBeSlow is <c>FALSE</c> and the server's response is not already cached from a previous call, the method
/// returns E_PENDING. In that case, set fOkToBeSlow to <c>TRUE</c> and call <c>IPreviousVersionsInfo::AreSnapshotsAvailable</c>
/// again to contact the server.
/// </para>
/// <para>
/// For better performance, a UI thread calling this method should always set fOkToBeSlow to <c>FALSE</c>. If the method returns
/// E_PENDING, follow these steps.
/// </para>
/// <list type="bullet">
/// <item>
/// <term>Create another instance of IPreviousVersionsInfo on a background thread.</term>
/// </item>
/// <item>
/// <term>Call <c>IPreviousVersionsInfo::AreSnapshotsAvailable</c> with fOkToBeSlow set to <c>TRUE</c>.</term>
/// </item>
/// <item>
/// <term>
/// Signal the original UI thread to call <c>IPreviousVersionsInfo::AreSnapshotsAvailable</c> again. The results are then pulled
/// from the cache.
/// </term>
/// </item>
/// </list>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ipreviousversionsinfo-aresnapshotsavailable HRESULT
// AreSnapshotsAvailable( LPCWSTR pszPath, BOOL fOkToBeSlow, BOOL *pfAvailable );
[return: MarshalAs(UnmanagedType.Bool)]
bool AreSnapshotsAvailable([MarshalAs(UnmanagedType.LPWStr)] string pszPath, [MarshalAs(UnmanagedType.Bool)] bool fOkToBeSlow);
}
/// <summary>CoClass for IPreviousVersionsInfo</summary>
[PInvokeData("shobjidl.h")]
[ComImport, Guid("596AB062-B4D2-4215-9F74-E9109B0A8153"), ClassInterface(ClassInterfaceType.None)]
public class PreviousVersionsInfo { }
}
}

View File

@ -0,0 +1,55 @@
using System;
using System.Runtime.InteropServices;
using Vanara.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Exposes methods that allow the caller to retrieve information entered into a search box.</summary>
/// <remarks>
/// <para>The search box is shown here in an Windows Explorer window frame.</para>
/// <para>The frame that contains the search box might also be hosted in another window or in the common file dialog box.</para>
/// <para>To access the search dialog, use QueryService using SID_SSearchBoxInfo on a site pointer within the Windows Explorer window.</para>
/// <para>When to Implement</para>
/// <para>An implementation of this interface is provided with Windows. Third parties do not need to implement their own version.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-isearchboxinfo
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.ISearchBoxInfo")]
[ComImport, Guid("6af6e03f-d664-4ef4-9626-f7e0ed36755e"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISearchBoxInfo
{
/// <summary>Retrieves the contents of the search box as an ICondition object.</summary>
/// <param name="riid">
/// <para>Type: <c>REFIID</c></para>
/// <para>A reference to the IID of the interface to retrieve through ppv, typically IID_ICondition.</para>
/// </param>
/// <param name="ppv">
/// <para>Type: <c>void**</c></para>
/// <para>When this method returns successfully, contains the interface pointer requested in riid. This is typically ICondition.</para>
/// </param>
/// <remarks>
/// <para>
/// As opposed to the text string retrieved by ISearchBoxInfo::GetText, <c>GetCondition</c> retrieves the same information as a
/// structured object, the methods of which can be used to parse and manipulate the search string.
/// </para>
/// <para>
/// We recommend that you use the <c>IID_PPV_ARGS</c> macro, defined in Objbase.h, to package the riid and ppv parameters. This
/// macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a
/// coding error in riid that could lead to unexpected results.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-isearchboxinfo-getcondition HRESULT GetCondition(
// REFIID riid, void **ppv );
void GetCondition(in Guid riid, [MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)] out object ppv);
/// <summary>Retrieves the contents of the search box as plain text.</summary>
/// <param name="ppsz">
/// <para>Type: <c>LPWSTR*</c></para>
/// <para>Pointer to a buffer that, when this method returns successfully, receives the full text entered in the search box.</para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-isearchboxinfo-gettext HRESULT GetText( LPWSTR *ppsz );
void GetText(out StrPtrUni ppsz);
}
}
}

View File

@ -0,0 +1,169 @@
using System;
using System.Runtime.InteropServices;
using System.Threading;
using System.Runtime.InteropServices.ComTypes;
using STATSTG = System.Runtime.InteropServices.ComTypes.STATSTG;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Exposes methods to manage input/outpout (I/O) to an asynchronous stream.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-istreamasync
[ComImport, Guid("fe0b6665-e0ca-49b9-a178-2b5cb48d92a5"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public unsafe interface IStreamAsync : IStream
{
/// <inheritdoc/>
new void Read(byte[] pv, int cb, IntPtr pcbRead);
/// <inheritdoc/>
new void Write(byte[] pv, int cb, IntPtr pcbWritten);
/// <inheritdoc/>
new void Seek(long dlibMove, int dwOrigin, IntPtr plibNewPosition);
/// <inheritdoc/>
new void SetSize(long libNewSize);
/// <inheritdoc/>
new void CopyTo(IStream pstm, long cb, IntPtr pcbRead, IntPtr pcbWritten);
/// <inheritdoc/>
new void Commit(int grfCommitFlags);
/// <inheritdoc/>
new void Revert();
/// <inheritdoc/>
new void LockRegion(long libOffset, long cb, int dwLockType);
/// <inheritdoc/>
new void UnlockRegion(long libOffset, long cb, int dwLockType);
/// <inheritdoc/>
new void Stat(out STATSTG pstatstg, int grfStatFlag);
/// <inheritdoc/>
new void Clone(out IStream ppstm);
/// <summary>
/// Reads information from a stream asynchronously. For example, the Shell implements this interface on file items when
/// transferring them asynchronously.
/// </summary>
/// <param name="pv">
/// <para>Type: <c>void*</c></para>
/// <para>
/// When this method returns successfully, returns a buffer that is cb bytes long and contains pcbRead bytes of information from
/// the read operation.
/// </para>
/// </param>
/// <param name="cb">
/// <para>Type: <c>DWORD</c></para>
/// <para>The number of bytes to read from the stream.</para>
/// </param>
/// <param name="pcbRead">
/// <para>Type: <c>LPDWORD</c></para>
/// <para>
/// Pointer to a <c>DWORD</c> value that, when this method returns successfully, states the actual number of bytes read to the
/// buffer pointed to by pv. This value can be <c>NULL</c>.
/// </para>
/// </param>
/// <param name="lpOverlapped">
/// <para>Type: <c>LPOVERLAPPED</c></para>
/// <para>A pointer to an OVERLAPPED structure that contains information used in the asynchronous read operation.</para>
/// </param>
/// <remarks>
/// <para>
/// <c>IStreamAsync::ReadAsync</c> should reset the event specified by the <c>hEvent</c> member of the OVERLAPPED structure to a
/// nonsignaled state when it begins the input/output (I/O) operation.
/// </para>
/// <para>This method has been implemented in the Shell as a thin wrapper around the public ReadFile API.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-istreamasync-readasync HRESULT ReadAsync( void *pv,
// DWORD cb, LPDWORD pcbRead, LPOVERLAPPED lpOverlapped );
void ReadAsync([Out] IntPtr pv, uint cb, out uint pcbRead, [In] NativeOverlapped* lpOverlapped);
/// <summary>
/// Writes information to a stream asynchronously. For example, the Shell implements this method on file items when transferring
/// them asynchronously.
/// </summary>
/// <param name="lpBuffer">
/// <para>Type: <c>const void*</c></para>
/// <para>A pointer to a buffer of size cb bytes that contains the information to be written to the stream.</para>
/// </param>
/// <param name="cb">
/// <para>Type: <c>DWORD</c></para>
/// <para>The size of the buffer pointed to by lpBuffer, in bytes.</para>
/// </param>
/// <param name="pcbWritten">
/// <para>Type: <c>LPDWORD</c></para>
/// <para>
/// Pointer to a <c>DWORD</c> value that, when the method returns successfully, states the actual number of bytes written to the
/// stream. This value can be <c>NULL</c> if this information is not needed.
/// </para>
/// </param>
/// <param name="lpOverlapped">
/// <para>Type: <c>LPOVERLAPPED</c></para>
/// <para>A pointer to an OVERLAPPED structure that contains information used in the asynchronous write operation.</para>
/// </param>
/// <remarks>
/// <c>WriteAsync</c> should reset the event specified by the <c>hEvent</c> member of the OVERLAPPED structure to a nonsignaled
/// state when it begins the input/output (I/O) operation.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-istreamasync-writeasync HRESULT WriteAsync( const
// void *lpBuffer, DWORD cb, LPDWORD pcbWritten, LPOVERLAPPED lpOverlapped );
void WriteAsync([In] IntPtr lpBuffer, uint cb, out uint pcbWritten, [In] NativeOverlapped* lpOverlapped);
/// <summary>Retrieves the results of an overlapped operation.</summary>
/// <param name="lpOverlapped">
/// <para>Type: <c>LPOVERLAPPED*</c></para>
/// <para>A pointer to the OVERLAPPED structure that was specified when the overlapped operation was started.</para>
/// </param>
/// <param name="lpNumberOfBytesTransferred">
/// <para>Type: <c>LPDWORD</c></para>
/// <para>When this method returns, contains the number of bytes that were actually transferred by a read or write operation.</para>
/// </param>
/// <param name="bWait">
/// <para>Type: <c>BOOL</c></para>
/// <para>
/// If <c>TRUE</c> the method does not return until the operation has been completed. If <c>FALSE</c> and an operation is
/// pending, the method returns the HRESULT equivalent to ERROR_IO_INCOMPLETE.
/// </para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-istreamasync-overlappedresult HRESULT
// OverlappedResult( LPOVERLAPPED lpOverlapped, LPDWORD lpNumberOfBytesTransferred, BOOL bWait );
void OverlappedResult([In] NativeOverlapped* lpOverlapped, out uint lpNumberOfBytesTransferred, [MarshalAs(UnmanagedType.Bool)] bool bWait);
/// <summary>Marks all pending input/output (I/O) operations as canceled.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-istreamasync-cancelio HRESULT CancelIo();
void CancelIo();
}
/// <summary>Exposes a method that determines the sector size as an aid to byte alignment.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-istreamunbufferedinfo
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IStreamUnbufferedInfo")]
[ComImport, Guid("8a68fdda-1fdc-4c20-8ceb-416643b5a625"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IStreamUnbufferedInfo
{
/// <summary>
/// Retrieves the number of bytes per sector on the disk currently being used. When using unbuffered input/output (I/O), it is
/// important to know the size of the sectors on the disk being read in order to ensure proper byte alignment.
/// </summary>
/// <param name="pcbSectorSize">
/// <para>Type: <c>ULONG*</c></para>
/// <para>
/// When this method returns successfully, contains a pointer to a <c>ULONG</c> value that represents the number of bytes per
/// sector for the disk.
/// </para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-istreamunbufferedinfo-getsectorsize HRESULT
// GetSectorSize( ULONG *pcbSectorSize );
[PreserveSig]
HRESULT GetSectorSize(out uint pcbSectorSize);
}
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Exposes a method which is called when the picture that represents a user account is changed.</summary>
/// <remarks>
/// <para>
/// Applications that want to notify users through this interface can add their class identifier (CLSID) strings as values under
/// this key:
/// </para>
/// <para><c>SOFTWARE</c><c>Microsoft</c><c>Windows</c><c>CurrentVersion</c><c>UserPictureChange</c></para>
/// <para>The values under this key are enumerated to create this callback object.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-iuseraccountchangecallback
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IUserAccountChangeCallback")]
[ComImport, Guid("a561e69a-b4b8-4113-91a5-64c6bcca3430"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IUserAccountChangeCallback
{
/// <summary>Called to send notifications when the picture that represents a user account is changed.</summary>
/// <param name="pszUserName">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>Pointer to a string that contains the user name. Set this parameter to <c>NULL</c> to specify the current user.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// <para>
/// When the picture that represents a user account changes, the callback object notifies all applications that are registered
/// under this registry subkey:
/// </para>
/// <para><c>SOFTWARE</c><c>Microsoft</c><c>Windows</c><c>CurrentVersion</c><c>UserPictureChange</c></para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-iuseraccountchangecallback-onpicturechange HRESULT
// OnPictureChange( LPCWSTR pszUserName );
[PreserveSig]
HRESULT OnPictureChange([MarshalAs(UnmanagedType.LPWStr)] string pszUserName);
}
}
}

View File

@ -0,0 +1,151 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>Specifies the use of a color. Used by IVisualProperties methods.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/ne-shobjidl-vpcolorflags typedef enum VPCOLORFLAGS { VPCF_TEXT,
// VPCF_BACKGROUND, VPCF_SORTCOLUMN, VPCF_SUBTEXT, VPCF_TEXTBACKGROUND } ;
[PInvokeData("shobjidl.h", MSDNShortId = "NE:shobjidl.VPCOLORFLAGS")]
public enum VPCOLORFLAGS
{
/// <summary>A text color.</summary>
VPCF_TEXT = 1,
/// <summary>A background color.</summary>
VPCF_BACKGROUND,
/// <summary>A sort-column color.</summary>
VPCF_SORTCOLUMN,
/// <summary>A subtext color.</summary>
VPCF_SUBTEXT,
/// <summary>Windows 7 and later. A text background color.</summary>
VPCF_TEXTBACKGROUND,
}
/// <summary>Specifies watermark flags. Used by IVisualProperties::SetWatermark.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/ne-shobjidl-vpwatermarkflags typedef enum VPWATERMARKFLAGS {
// VPWF_DEFAULT, VPWF_ALPHABLEND } ;
[PInvokeData("shobjidl.h", MSDNShortId = "NE:shobjidl.VPWATERMARKFLAGS")]
[Flags]
public enum VPWATERMARKFLAGS
{
/// <summary>Default Windows XP behavior.</summary>
VPWF_DEFAULT = 0,
/// <summary>Alpha blend the respective bitmap; assumed 24-bit color + 8-bit alpha.</summary>
VPWF_ALPHABLEND = 1,
}
/// <summary>Exposes methods that set and get visual properties.</summary>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nn-shobjidl-ivisualproperties
[PInvokeData("shobjidl.h", MSDNShortId = "NN:shobjidl.IVisualProperties")]
[ComImport, Guid("e693cf68-d967-4112-8763-99172aee5e5a"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVisualProperties
{
/// <summary>Provides a bitmap to use as a watermark.</summary>
/// <param name="hbmp">
/// <para>Type: <c>HBITMAP</c></para>
/// <para>A handle to the bitmap.</para>
/// </param>
/// <param name="vpwf">
/// <para>Type: <c>VPWATERMARKFLAGS</c></para>
/// <para>VPWATERMARKFLAGS flags that customize the watermark.</para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-setwatermark HRESULT SetWatermark(
// HBITMAP hbmp, VPWATERMARKFLAGS vpwf );
void SetWatermark(HBITMAP hbmp, VPWATERMARKFLAGS vpwf);
/// <summary>Sets the color, as specified.</summary>
/// <param name="vpcf">
/// <para>Type: <c>VPCOLORFLAGS</c></para>
/// <para>The color flags. See VPCOLORFLAGS.</para>
/// </param>
/// <param name="cr">
/// <para>Type: <c>COLORREF</c></para>
/// <para>A value of type COLORREF</para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-setcolor HRESULT SetColor(
// VPCOLORFLAGS vpcf, COLORREF cr );
void SetColor(VPCOLORFLAGS vpcf, COLORREF cr);
/// <summary>Gets the color, as specified.</summary>
/// <param name="vpcf">
/// <para>Type: <c>VPCOLORFLAGS</c></para>
/// <para>The color flags. See VPCOLORFLAGS</para>
/// </param>
/// <returns>
/// <para>Type: <c>COLORREF*</c></para>
/// <para>A pointer to a value of type COLORREF.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-getcolor HRESULT GetColor(
// VPCOLORFLAGS vpcf, COLORREF *pcr );
COLORREF GetColor(VPCOLORFLAGS vpcf);
/// <summary>Sets the specified item height.</summary>
/// <param name="cyItemInPixels">
/// <para>Type: <c>int</c></para>
/// <para>The item height, in pixels.</para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-setitemheight HRESULT
// SetItemHeight( int cyItemInPixels );
void SetItemHeight(int cyItemInPixels);
/// <summary>Gets the item height.</summary>
/// <returns>
/// <para>Type: <c>int*</c></para>
/// <para>A pointer to the item height, in pixels.</para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-getitemheight HRESULT
// GetItemHeight( int *cyItemInPixels );
int GetItemHeight();
/// <summary>Sets attributes of the font.</summary>
/// <param name="plf">
/// <para>Type: <c>const LOGFONTW*</c></para>
/// <para>A pointer to a LOGFONT structure that contains the attributes to set.</para>
/// </param>
/// <param name="bRedraw">
/// <para>Type: <c>BOOL</c></para>
/// <para><c>TRUE</c> if the item should be redrawn after the new attributes are set; otherwise <c>FALSE</c>.</para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-setfont HRESULT SetFont( const
// LOGFONTW *plf, BOOL bRedraw );
void SetFont(in LOGFONT plf, [MarshalAs(UnmanagedType.Bool)] bool bRedraw);
/// <summary>Gets the current attributes set on the font.</summary>
/// <returns>
/// <para>Type: <c>LOGFONTW*</c></para>
/// <para>
/// A pointer to a LOGFONT structure that, when this method returns successfully, receives the current attributes of the font.
/// </para>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-getfont HRESULT GetFont( LOGFONTW
// *plf );
LOGFONT GetFont();
/// <summary>Sets the specified theme.</summary>
/// <param name="pszSubAppName">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a Unicode string that contains the application name to use in place of the calling application's name. If this
/// parameter is <c>NULL</c>, the calling application's name is used.
/// </para>
/// </param>
/// <param name="pszSubIdList">
/// <para>Type: <c>LPCWSTR</c></para>
/// <para>
/// A pointer to a Unicode string that contains a semicolon-separated list of CLSID names for use in place of the actual list
/// passed by the window's class. If this parameter is <c>NULL</c>, the ID list from the calling class is used.
/// </para>
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl/nf-shobjidl-ivisualproperties-settheme HRESULT SetTheme( LPCWSTR
// pszSubAppName, LPCWSTR pszSubIdList );
void SetTheme([MarshalAs(UnmanagedType.LPWStr)] string pszSubAppName, [MarshalAs(UnmanagedType.LPWStr)] string pszSubIdList);
}
}
}

View File

@ -4,6 +4,135 @@ namespace Vanara.PInvoke
{
public static partial class Shell32
{
/// <summary>CLSID_ACLCustomMRU</summary>
public static readonly Guid CLSID_ACLCustomMRU = new Guid(0x6935db93, 0x21e8, 0x4ccc, 0xbe, 0xb9, 0x9f, 0xe3, 0xc7, 0x7a, 0x29, 0x7a);
/// <summary>CLSID_ACLHistory</summary>
public static readonly Guid CLSID_ACLHistory = new Guid(0x00BB2764, 0x6A77, 0x11D0, 0xA5, 0x35, 0x00, 0xC0, 0x4F, 0xD7, 0xD0, 0x62);
/// <summary>CLSID_ACListISF</summary>
public static readonly Guid CLSID_ACListISF = new Guid(0x03C036F1, 0xA186, 0x11D0, 0x82, 0x4A, 0x00, 0xAA, 0x00, 0x5B, 0x43, 0x83);
/// <summary>CLSID_ACLMRU</summary>
public static readonly Guid CLSID_ACLMRU = new Guid(0x6756a641, 0xde71, 0x11d0, 0x83, 0x1b, 0x0, 0xaa, 0x0, 0x5b, 0x43, 0x83);
/// <summary>CLSID_ACLMulti</summary>
public static readonly Guid CLSID_ACLMulti = new Guid(0x00BB2765, 0x6A77, 0x11D0, 0xA5, 0x35, 0x00, 0xC0, 0x4F, 0xD7, 0xD0, 0x62);
/// <summary>CLSID_AutoComplete</summary>
public static readonly Guid CLSID_AutoComplete = new Guid(0x00BB2763, 0x6A77, 0x11D0, 0xA5, 0x35, 0x00, 0xC0, 0x4F, 0xD7, 0xD0, 0x62);
/// <summary>CLSID_CAnchorBrowsePropertyPage</summary>
public static readonly Guid CLSID_CAnchorBrowsePropertyPage = new Guid(0x3050f3BB, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
/// <summary>CLSID_CDocBrowsePropertyPage</summary>
public static readonly Guid CLSID_CDocBrowsePropertyPage = new Guid(0x3050f3B4, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
/// <summary>CLSID_CFSIconOverlayManager</summary>
public static readonly Guid CLSID_CFSIconOverlayManager = new Guid(0x63B51F81, 0xC868, 0x11D0, 0x99, 0x9C, 0x00, 0xC0, 0x4F, 0xD6, 0x55, 0xE1);
/// <summary>CLSID_CImageBrowsePropertyPage</summary>
public static readonly Guid CLSID_CImageBrowsePropertyPage = new Guid(0x3050f3B3, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
/// <summary>CLSID_ControlPanel</summary>
public static readonly Guid CLSID_ControlPanel = new Guid(0x21EC2020, 0x3AEA, 0x1069, 0xA2, 0xDD, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
/// <summary>CLSID_CUrlHistory</summary>
public static readonly Guid CLSID_CUrlHistory = new Guid(0x3C374A40, 0xBAE4, 0x11CF, 0xBF, 0x7D, 0x00, 0xAA, 0x00, 0x69, 0x46, 0xEE);
/// <summary>CLSID_CURLSearchHook</summary>
public static readonly Guid CLSID_CURLSearchHook = new Guid(0xCFBFAE00, 0x17A6, 0x11D0, 0x99, 0xCB, 0x00, 0xC0, 0x4F, 0xD6, 0x44, 0x97);
/// <summary>CLSID_DarwinAppPublisher</summary>
public static readonly Guid CLSID_DarwinAppPublisher = new Guid(0xCFCCC7A0, 0xA282, 0x11D1, 0x90, 0x82, 0x00, 0x60, 0x08, 0x05, 0x93, 0x82);
/// <summary>CLSID_DocHostUIHandler</summary>
public static readonly Guid CLSID_DocHostUIHandler = new Guid(0x7057e952, 0xbd1b, 0x11d1, 0x89, 0x19, 0x0, 0xc0, 0x4f, 0xc2, 0xc8, 0x36);
/// <summary>CLSID_DragDropHelper</summary>
public static readonly Guid CLSID_DragDropHelper = new Guid(0x4657278a, 0x411b, 0x11d2, 0x83, 0x9a, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0xd0);
/// <summary>CLSID_FileTypes</summary>
public static readonly Guid CLSID_FileTypes = new Guid(0xB091E540, 0x83E3, 0x11CF, 0xA7, 0x13, 0x00, 0x20, 0xAF, 0xD7, 0x97, 0x62);
/// <summary>CLSID_FolderItem</summary>
public static readonly Guid CLSID_FolderItem = new Guid(0xfef10fa2, 0x355e, 0x4e06, 0x93, 0x81, 0x9b, 0x24, 0xd7, 0xf7, 0xcc, 0x88);
/// <summary>CLSID_FolderItemsMultiLevel</summary>
public static readonly Guid CLSID_FolderItemsMultiLevel = new Guid(0x53c74826, 0xab99, 0x4d33, 0xac, 0xa4, 0x31, 0x17, 0xf5, 0x1d, 0x37, 0x88);
/// <summary>CLSID_FolderShortcut</summary>
public static readonly Guid CLSID_FolderShortcut = new Guid(0x0AFACED1, 0xE828, 0x11D1, 0x91, 0x87, 0xB5, 0x32, 0xF1, 0xE9, 0x57, 0x5D);
/// <summary>CLSID_HWShellExecute</summary>
public static readonly Guid CLSID_HWShellExecute = new Guid(0xffb8655f, 0x81b9, 0x4fce, 0xb8, 0x9c, 0x9a, 0x6b, 0xa7, 0x6d, 0x13, 0xe7);
/// <summary>CLSID_Internet</summary>
public static readonly Guid CLSID_Internet = new Guid(0x871C5380, 0x42A0, 0x1069, 0xA2, 0xEA, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
/// <summary>CLSID_InternetButtons</summary>
public static readonly Guid CLSID_InternetButtons = new Guid(0x1E796980, 0x9CC5, 0x11D1, 0xA8, 0x3F, 0x00, 0xC0, 0x4F, 0xC9, 0x9D, 0x61);
/// <summary>CLSID_ISFBand</summary>
public static readonly Guid CLSID_ISFBand = new Guid(0xD82BE2B0, 0x5764, 0x11D0, 0xA9, 0x6E, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2);
/// <summary>CLSID_LinkColumnProvider</summary>
public static readonly Guid CLSID_LinkColumnProvider = new Guid(0x24f14f02, 0x7b1c, 0x11d1, 0x83, 0x8f, 0x0, 0x0, 0xf8, 0x4, 0x61, 0xcf);
/// <summary>CLSID_MenuBand</summary>
public static readonly Guid CLSID_MenuBand = new Guid(0x5b4dae26, 0xb807, 0x11d0, 0x98, 0x15, 0x0, 0xc0, 0x4f, 0xd9, 0x19, 0x72);
/// <summary>CLSID_MenuBandSite</summary>
public static readonly Guid CLSID_MenuBandSite = new Guid(0xe13ef4e4, 0xd2f2, 0x11d0, 0x98, 0x16, 0x0, 0xc0, 0x4f, 0xd9, 0x19, 0x72);
/// <summary>CLSID_MenuToolbarBase</summary>
public static readonly Guid CLSID_MenuToolbarBase = new Guid(0x40b96610, 0xb522, 0x11d1, 0xb3, 0xb4, 0x0, 0xaa, 0x0, 0x6e, 0xfd, 0xe7);
/// <summary>CLSID_MSOButtons</summary>
public static readonly Guid CLSID_MSOButtons = new Guid(0x178f34b8, 0xa282, 0x11d2, 0x86, 0xc5, 0x0, 0xc0, 0x4f, 0x8e, 0xea, 0x99);
/// <summary>CLSID_MyComputer</summary>
public static readonly Guid CLSID_MyComputer = new Guid(0x20D04FE0, 0x3AEA, 0x1069, 0xA2, 0xD8, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
/// <summary>CLSID_MyDocuments</summary>
public static readonly Guid CLSID_MyDocuments = new Guid(0x450d8fba, 0xad25, 0x11d0, 0x98, 0xa8, 0x08, 0x00, 0x36, 0x1b, 0x11, 0x03);
/// <summary>CLSID_NetworkDomain</summary>
public static readonly Guid CLSID_NetworkDomain = new Guid(0x46e06680, 0x4bf0, 0x11d1, 0x83, 0xee, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0x49);
/// <summary>CLSID_NetworkServer</summary>
public static readonly Guid CLSID_NetworkServer = new Guid(0xc0542a90, 0x4bf0, 0x11d1, 0x83, 0xee, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0x49);
/// <summary>CLSID_NetworkShare</summary>
public static readonly Guid CLSID_NetworkShare = new Guid(0x54a754c0, 0x4bf0, 0x11d1, 0x83, 0xee, 0x00, 0xa0, 0xc9, 0x0d, 0xc8, 0x49);
/// <summary>CLSID_NewMenu</summary>
public static readonly Guid CLSID_NewMenu = new Guid(0xd969a300, 0xe7ff, 0x11d0, 0xa9, 0x3b, 0x0, 0xa0, 0xc9, 0xf, 0x27, 0x19);
/// <summary>CLSID_Printers</summary>
public static readonly Guid CLSID_Printers = new Guid(0x2227A280, 0x3AEA, 0x1069, 0xA2, 0xDE, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D);
/// <summary>CLSID_ProgressDialog</summary>
public static readonly Guid CLSID_ProgressDialog = new Guid(0xf8383852, 0xfcd3, 0x11d1, 0xa6, 0xb9, 0x0, 0x60, 0x97, 0xdf, 0x5b, 0xd4);
/// <summary>CLSID_QueryAssociations</summary>
public static readonly Guid CLSID_QueryAssociations = new Guid(0xa07034fd, 0x6caa, 0x4954, 0xac, 0x3f, 0x97, 0xa2, 0x72, 0x16, 0xf9, 0x8a);
/// <summary>CLSID_QuickLinks</summary>
public static readonly Guid CLSID_QuickLinks = new Guid(0xe5cbf21, 0xd15f, 0x11d0, 0x83, 0x1, 0x0, 0xaa, 0x0, 0x5b, 0x43, 0x83);
/// <summary>CLSID_RecycleBin</summary>
public static readonly Guid CLSID_RecycleBin = new Guid(0x645FF040, 0x5081, 0x101B, 0x9F, 0x08, 0x00, 0xAA, 0x00, 0x2F, 0x95, 0x4E);
/// <summary>CLSID_ShellFldSetExt</summary>
public static readonly Guid CLSID_ShellFldSetExt = new Guid(0x6D5313C0, 0x8C62, 0x11D1, 0xB2, 0xCD, 0x00, 0x60, 0x97, 0xDF, 0x8C, 0x11);
/// <summary>CLSID_ShellThumbnailDiskCache</summary>
public static readonly Guid CLSID_ShellThumbnailDiskCache = new Guid(0x1ebdcf80, 0xa200, 0x11d0, 0xa3, 0xa4, 0x0, 0xc0, 0x4f, 0xd7, 0x6, 0xec);
/// <summary>CLSID_ToolbarExtButtons</summary>
public static readonly Guid CLSID_ToolbarExtButtons = new Guid(0x2ce4b5d8, 0xa28f, 0x11d2, 0x86, 0xc5, 0x0, 0xc0, 0x4f, 0x8e, 0xea, 0x99);
/// <summary>Service ID to find common dialog browser.</summary>
[PInvokeData("shlguid.h")]
public static readonly Guid SID_SCommDlgBrowser = new Guid(0x80f30233, 0xb7df, 0x11d2, 0xa3, 0x3b, 0x0, 0x60, 0x97, 0xdf, 0x5b, 0xd4);
@ -144,8 +273,8 @@ namespace Vanara.PInvoke
BHID_ThumbnailHandler,
/// <summary>
/// Introduced in Windows Vista: If the item is a folder, gets an IEnumShellItems object that enumerates all items in the folder.
/// This includes folders, nonfolders, and hidden items.
/// Introduced in Windows Vista: If the item is a folder, gets an IEnumShellItems object that enumerates all items in the
/// folder. This includes folders, nonfolders, and hidden items.
/// </summary>
[Associate("{94f60519-2850-4924-aa5a-d15e84868039}")]
BHID_EnumItems,
@ -183,7 +312,8 @@ namespace Vanara.PInvoke
FOLDERTYPEID_AccountPictures,
/// <summary>
/// Introduced in Windows 7. A folder that contains communication-related files such as emails, calendar information, and contact information.
/// Introduced in Windows 7. A folder that contains communication-related files such as emails, calendar information, and
/// contact information.
/// </summary>
[Associate("{91475fe5-586b-4eba-8d75-d17434b8cdf6}")]
FOLDERTYPEID_Communications,