using System; using System.Runtime.InteropServices; namespace Vanara.PInvoke { /// Items from the WTSApi32.dll public static partial class WTSApi32 { /// Specifies the type of hint represented by a call to . [PInvokeData("wtshintapi.h", MSDNShortId = "NF:wtshintapi.WTSSetRenderHint")] public enum RENDER_HINT { /// /// The previous hint is cleared. /// pHintData must be NULL. /// RENDER_HINT_CLEAR = 0x0, /// /// Indicates the presence of moving video. /// /// pHintData contains a RECT structure which specifies the coordinates and size of the rendering area. These per-monitor /// DPI-aware coordinates are relative to the client coordinates of the window represented by the hwndOwner parameter. /// /// RENDER_HINT_VIDEO = 0x1, /// /// Indicates the presence of a window mapping. /// /// pHintData contains a RECT structure which specifies the coordinates and size of the rendering area. These per-monitor /// DPI-aware coordinates are relative to the client coordinates of the window represented by the hwndOwner parameter. /// /// /// Windows 8 and Windows Server 2012: The coordinates are not DPI-aware before Windows 8.1 and Windows Server 2012 R2. /// /// RENDER_HINT_MAPPEDWINDOW = 0x2, } /// /// /// Used by an application that is displaying content that can be optimized for displaying in a remote session to identify the /// region of a window that is the actual content. /// /// In the remote session, this content will be encoded, sent to the client, then decoded and displayed. /// /// /// The address of a value that identifies the rendering hint affected by this call. If a new hint is being created, this value must /// contain zero. This function will return a unique rendering hint identifier which is used for subsequent calls, such as clearing /// the hint. /// /// /// The handle of window linked to lifetime of the rendering hint. This window is used in situations where a hint target is removed /// without the hint being explicitly cleared. /// /// /// Specifies the type of hint represented by this call. /// RENDER_HINT_CLEAR (0) /// The previous hint is cleared. /// pHintData must be NULL. /// RENDER_HINT_VIDEO (1) /// Indicates the presence of moving video. /// /// pHintData contains a RECT structure which specifies the coordinates and size of the rendering area. These per-monitor DPI-aware /// coordinates are relative to the client coordinates of the window represented by the hwndOwner parameter. /// /// /// Windows 8 and Windows Server 2012: The coordinates are not DPI-aware before Windows 8.1 and Windows Server 2012 R2. /// /// RENDER_HINT_MAPPEDWINDOW (2) /// Indicates the presence of a window mapping. /// /// pHintData contains a RECT structure which specifies the coordinates and size of the rendering area. These per-monitor DPI-aware /// coordinates are relative to the client coordinates of the window represented by the hwndOwner parameter. /// /// /// Windows 8 and Windows Server 2012: The coordinates are not DPI-aware before Windows 8.1 and Windows Server 2012 R2. /// /// /// The size, in BYTE s, of the pHintData buffer. /// /// Additional data for the hint. /// The format of this data is dependent upon the value passed in the renderHintType parameter. /// /// If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. // https://docs.microsoft.com/en-us/windows/win32/api/wtshintapi/nf-wtshintapi-wtssetrenderhint HRESULT WTSSetRenderHint( UINT64 // *pRenderHintID, HWND hwndOwner, DWORD renderHintType, DWORD cbHintDataLength, BYTE *pHintData ); [DllImport(Lib_WTSApi32, SetLastError = false, ExactSpelling = true)] [PInvokeData("wtshintapi.h", MSDNShortId = "NF:wtshintapi.WTSSetRenderHint")] public static extern HRESULT WTSSetRenderHint(ref ulong pRenderHintID, HWND hwndOwner, RENDER_HINT renderHintType, uint cbHintDataLength, [In, Optional] IntPtr pHintData); } }