using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
///
/// Defines the set of possible general window (app view) size preferences. Used by
/// ILaunchSourceViewSizePreference::GetSourceViewSizePreference and ILaunchTargetViewSizePreference::GetTargetViewSizePreference.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/ne-shobjidl_core-application_view_size_preference typedef enum
// APPLICATION_VIEW_SIZE_PREFERENCE { AVSP_DEFAULT, AVSP_USE_LESS, AVSP_USE_HALF, AVSP_USE_MORE, AVSP_USE_MINIMUM, AVSP_USE_NONE,
// AVSP_CUSTOM } ;
[PInvokeData("shobjidl_core.h", MSDNShortId = "NE:shobjidl_core.APPLICATION_VIEW_SIZE_PREFERENCE")]
public enum APPLICATION_VIEW_SIZE_PREFERENCE
{
///
/// The app does not specify a window size preference. Windows, rather than the app, sets the size preference, which defaults to AVSP_USE_HALF.
///
AVSP_DEFAULT,
/// Prefers to use less than 50% of the available horizontal screen pixels.
AVSP_USE_LESS,
/// Prefers to use 50% (half) of the available horizontal screen pixels.
AVSP_USE_HALF,
/// Prefers to use more than 50% of the available horizontal screen pixels.
AVSP_USE_MORE,
/// Prefers to use the minimum horizontal pixel width (either 320 or 500 pixels) specified in the app's manifest.
AVSP_USE_MINIMUM,
/// The window has no visible component.
AVSP_USE_NONE,
///
AVSP_CUSTOM,
}
/// Provides a method for retrieving an AppUserModelId.
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ilaunchsourceappusermodelid
[PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.ILaunchSourceAppUserModelId")]
[ComImport, Guid("989191AC-28FF-4CF0-9584-E0D078BC2396"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ILaunchSourceAppUserModelId
{
/// Retrieves an AppUserModelId from the source application.
///
/// Type: LPWSTR*
/// Contains a pointer to a string that contains the AppUserModelId.
///
///
/// Type: HRESULT
/// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ilaunchsourceappusermodelid-getappusermodelid
// HRESULT GetAppUserModelId( LPWSTR *launchingApp );
[PreserveSig]
HRESULT GetAppUserModelId([MarshalAs(UnmanagedType.LPWStr)] out string launchingApp);
}
/// Provides methods for retrieving information about the source application.
///
/// When to implement
/// -->
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ilaunchsourceviewsizepreference
[ComImport, Guid("E5AA01F7-1FB8-4830-8720-4E6734CBD5F3"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ILaunchSourceViewSizePreference
{
/// Retrieves the position of the source application window.
///
/// Type: HWND*
/// Contains the address of a pointer to a window handle.
///
///
/// Type: HRESULT
/// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ilaunchsourceviewsizepreference-getsourceviewtoposition
// HRESULT GetSourceViewToPosition( HWND *hwnd );
[PreserveSig]
HRESULT GetSourceViewToPosition(out HWND hwnd);
/// Retrieves the view size preference of the application after the application has launched.
///
/// Type: APPLICATION_VIEW_SIZE_PREFERENCE*
/// Contains the address of a pointer to an APPLICATION_VIEW_SIZE_PREFERENCE.
///
///
/// Type: HRESULT
/// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ilaunchsourceviewsizepreference-getsourceviewsizepreference
// HRESULT GetSourceViewSizePreference( APPLICATION_VIEW_SIZE_PREFERENCE *sourceSizeAfterLaunch );
[PreserveSig]
HRESULT GetSourceViewSizePreference(out APPLICATION_VIEW_SIZE_PREFERENCE sourceSizeAfterLaunch);
}
/// Provides a method for retrieving the preferred view size for a new application window.
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ilaunchtargetviewsizepreference
[ComImport, Guid("2F0666C6-12F7-4360-B511-A394A0553725"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ILaunchTargetViewSizePreference
{
/// Retrieves the preferred view size of the application being launched.
///
/// Type: APPLICATION_VIEW_SIZE_PREFERENCE*
/// Contains the address of a pointer to an APPLICATION_VIEW_SIZE_PREFERENCE for the target application.
///
///
/// Type: HRESULT
/// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
///
// https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ilaunchtargetviewsizepreference-gettargetviewsizepreference
// HRESULT GetTargetViewSizePreference( APPLICATION_VIEW_SIZE_PREFERENCE *targetSizeOnLaunch );
[PreserveSig]
HRESULT GetTargetViewSizePreference(out APPLICATION_VIEW_SIZE_PREFERENCE targetSizeOnLaunch);
}
}
}