mirror of https://github.com/dahall/Vanara.git
Added new functions introducted in Win11
parent
f60a379236
commit
17acbee104
|
@ -5,6 +5,29 @@ namespace Vanara.PInvoke
|
|||
{
|
||||
public static partial class Kernel32
|
||||
{
|
||||
/// <summary>Undocumented</summary>
|
||||
[PInvokeData("winbase.h", MinClient = PInvokeClient.Windows11)]
|
||||
public enum FILE_FLUSH_MODE
|
||||
{
|
||||
/// <summary>same as WIN32 FlushFileBuffers(); Flushes data, metadata, AND sends a SYNC command to the hardware</summary>
|
||||
FILE_FLUSH_DEFAULT = 0,
|
||||
/// <summary>Flush data only</summary>
|
||||
FILE_FLUSH_DATA,
|
||||
/// <summary>Flush data + SYNC (minimal metadata)</summary>
|
||||
FILE_FLUSH_MIN_METADATA,
|
||||
/// <summary>Flush data + metadata</summary>
|
||||
FILE_FLUSH_NO_SYNC,
|
||||
}
|
||||
|
||||
/// <summary>Undocumented</summary>
|
||||
[PInvokeData("winbase.h", MinClient = PInvokeClient.Windows11)]
|
||||
public enum FILE_WRITE_FLAGS
|
||||
{
|
||||
/// <summary>Undocumented</summary>
|
||||
FILE_WRITE_FLAGS_NONE,
|
||||
/// <summary>Undocumented</summary>
|
||||
FILE_WRITE_FLAGS_WRITE_THROUGH = 0x000000001,
|
||||
}
|
||||
/// <summary>Specifies advisory flags for creating an I/O ring with a call to CreateIoRing.</summary>
|
||||
/// <remarks>
|
||||
/// Use the IORING_CREATE_FLAGS structure to pass flags into <c>CreateIoRing</c>. Any unknown or unsupported advisory flags provided
|
||||
|
@ -115,6 +138,52 @@ namespace Vanara.PInvoke
|
|||
[PInvokeData("ioringapi.h", MSDNShortId = "NF:ioringapi.BuildIoRingCancelRequest", MinClient = PInvokeClient.Windows11)]
|
||||
public static extern HRESULT BuildIoRingCancelRequest(HIORING ioRing, IORING_HANDLE_REF file, IntPtr opToCancel, [In, Optional] IntPtr userData);
|
||||
|
||||
/// <summary>Undocumented.</summary>
|
||||
/// <param name="ioRing">An <c>HIORING</c> representing a handle to the I/O ring for which a cancellation is requested.</param>
|
||||
/// <param name="fileRef">An IORING_HANDLE_REF representing the file associated with the operation to flush.</param>
|
||||
/// <param name="flushMode">The flush mode.</param>
|
||||
/// <param name="userData">
|
||||
/// A UINT_PTR value identifying the file write operation. Specify this value when cancelling the operation with a call to
|
||||
/// BuildIoRingCancelRequest. If an app implements cancellation behavior for the operation, the userData value must be unique.
|
||||
/// Otherwise, the value is treated as opaque by the system and can be anything, including 0.
|
||||
/// </param>
|
||||
/// <param name="sqeFlags">
|
||||
/// A bitwise OR combination of values from the IORING_SQE_FLAGS enumeration specifying kernel behavior options for I/O ring
|
||||
/// submission queue entries.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// <list type="table">
|
||||
/// <listheader>
|
||||
/// <term>Value</term>
|
||||
/// <term>Description</term>
|
||||
/// </listheader>
|
||||
/// <item>
|
||||
/// <term>S_OK</term>
|
||||
/// <term>Success</term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>IORING_E_SUBMISSION_QUEUE_FULL</term>
|
||||
/// <term>
|
||||
/// The submission queue is full, and no additional entries are available to build. The application must submit the existing entries
|
||||
/// and wait for some of them to complete before adding more operations to the queue.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>IORING_E_UNKNOWN_REQUIRED_FLAG</term>
|
||||
/// <term>
|
||||
/// The application provided a required flag that is not known to the implementation. Library code should check the IoRingVersion
|
||||
/// field of the IORING_INFO obtained from a call to GetIoRingInfo to determine the API version of an I/O ring which determines the
|
||||
/// operations and flags that are supported. Applications should know the version they used to create the I/O ring and therefore
|
||||
/// should not provide unsupported flags at runtime.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// </returns>
|
||||
[DllImport(Lib.KernelBase, SetLastError = false, ExactSpelling = true)]
|
||||
[PInvokeData("ioringapi.h", MinClient = PInvokeClient.Windows11)]
|
||||
public static extern HRESULT BuildIoRingFlushFile([In] HIORING ioRing, IORING_HANDLE_REF fileRef, FILE_FLUSH_MODE flushMode,
|
||||
IntPtr userData, IORING_SQE_FLAGS sqeFlags);
|
||||
|
||||
/// <summary>Performs an asynchronous read from a file using an I/O ring. This operation is similar to calling ReadFileEx.</summary>
|
||||
/// <param name="ioRing">An <c>HIORING</c> representing a handle to the I/O ring which will perform the read operation.</param>
|
||||
/// <param name="fileRef">An IORING_HANDLE_REF specifying the file to read.</param>
|
||||
|
@ -275,6 +344,61 @@ namespace Vanara.PInvoke
|
|||
public static extern HRESULT BuildIoRingRegisterFileHandles(HIORING ioRing, uint count,
|
||||
[In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] HANDLE[] handles, [In, Optional] IntPtr userData);
|
||||
|
||||
/// <summary>Undocumented. Performs an asynchronous write to a file using an I/O ring. This operation is similar to calling WriteFileEx.</summary>
|
||||
/// <param name="ioRing">An <c>HIORING</c> representing a handle to the I/O ring for which a cancellation is requested.</param>
|
||||
/// <param name="fileRef">An IORING_HANDLE_REF specifying the file to write.</param>
|
||||
/// <param name="bufferRef">
|
||||
/// An IORING_BUFFER_REF specifying the buffer into which the file is write. The provided buffer must have a size of at least
|
||||
/// numberOfBytesToRead bytes.
|
||||
/// </param>
|
||||
/// <param name="numberOfBytesToWrite">The number of bytes to write.</param>
|
||||
/// <param name="fileOffset">The offset into the file to begin reading.</param>
|
||||
/// <param name="writeFlags">The write flags.</param>
|
||||
/// <param name="userData">
|
||||
/// A UINT_PTR value identifying the file write operation. Specify this value when cancelling the operation with a call to
|
||||
/// BuildIoRingCancelRequest. If an app implements cancellation behavior for the operation, the userData value must be unique.
|
||||
/// Otherwise, the value is treated as opaque by the system and can be anything, including 0.
|
||||
/// </param>
|
||||
/// <param name="sqeFlags">
|
||||
/// A bitwise OR combination of values from the IORING_SQE_FLAGS enumeration specifying kernel behavior options for I/O ring
|
||||
/// submission queue entries.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// <para>Returns an HRESULT including, but not limited to the following:</para>
|
||||
/// <list type="table">
|
||||
/// <listheader>
|
||||
/// <term>Value</term>
|
||||
/// <term>Description</term>
|
||||
/// </listheader>
|
||||
/// <item>
|
||||
/// <term>S_OK</term>
|
||||
/// <term>Success</term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>IORING_E_SUBMISSION_QUEUE_FULL</term>
|
||||
/// <term>
|
||||
/// The submission queue is full, and no additional entries are available to build. The application must submit the existing entries
|
||||
/// and wait for some of them to complete before adding more operations to the queue.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>IORING_E_UNKNOWN_REQUIRED_FLAG</term>
|
||||
/// <term>
|
||||
/// The application provided a required flag that is not known to the implementation. Library code should check the IoRingVersion
|
||||
/// field of the IORING_INFO obtained from a call to GetIoRingInfo to determine the API version of an I/O ring which determines the
|
||||
/// operations and flags that are supported. Applications should know the version they used to create the I/O ring and therefore
|
||||
/// should not provide unsupported flags at runtime.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// Check I/O ring support for read file operations by calling IsIoRingOpSupported and specifying IORING_OP_WRITE for the op parameter.
|
||||
/// </remarks>
|
||||
[DllImport(Lib.KernelBase, SetLastError = false, ExactSpelling = true)]
|
||||
[PInvokeData("ioringapi.h", MinClient = PInvokeClient.Windows11)]
|
||||
public static extern HRESULT BuildIoRingWriteFile([In] HIORING ioRing, IORING_HANDLE_REF fileRef, IORING_BUFFER_REF bufferRef,
|
||||
uint numberOfBytesToWrite, ulong fileOffset, FILE_WRITE_FLAGS writeFlags, IntPtr userData, IORING_SQE_FLAGS sqeFlags);
|
||||
/// <summary>Closes an <c>HIORING</c> handle that was previously opened with a call to CreateIoRing.</summary>
|
||||
/// <param name="ioRing">The <c>HIORING</c> handle to close.</param>
|
||||
/// <returns>Returns S_OK on success.</returns>
|
||||
|
@ -462,6 +586,53 @@ namespace Vanara.PInvoke
|
|||
[PInvokeData("ioringapi.h", MSDNShortId = "NF:ioringapi.QueryIoRingCapabilities", MinClient = PInvokeClient.Windows11)]
|
||||
public static extern HRESULT QueryIoRingCapabilities(out IORING_CAPABILITIES capabilities);
|
||||
|
||||
/// <summary>Registers a completion queue event with an I/O ring.</summary>
|
||||
/// <param name="ioRing">An <c>HIORING</c> representing a handle to the I/O ring for which the completion event is registered.</param>
|
||||
/// <param name="hEvent">A handle to the event object. The CreateEvent or OpenEvent function returns this handle.</param>
|
||||
/// <returns>
|
||||
/// <para>Returns an HRESULT including the following values:</para>
|
||||
/// <list type="table">
|
||||
/// <listheader>
|
||||
/// <term>Value</term>
|
||||
/// <term>Description</term>
|
||||
/// </listheader>
|
||||
/// <item>
|
||||
/// <term>S_OK</term>
|
||||
/// <term>Success</term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>E_INVALID_HANDLE</term>
|
||||
/// <term>An invalid handle was passed in the <c>ioRing</c> parameter.</term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>E_INVALIDARG</term>
|
||||
/// <term>An invalid handle was passed in the <c>hEvent</c> parameter.</term>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The kernel will signal this event when it places the first entry into an empty completion queue, i.e. the kernel only sets the
|
||||
/// event to the signaled state when the completion queue transitions from the empty to non-empty state. Applications should call
|
||||
/// PopIoRingCompletion until it indicates no more entries and then wait for any additional async completions to complete via the
|
||||
/// provided HANDLE. Otherwise, the event won’t enter the signaled state and the wait may block until a timeout occurs, or forever if
|
||||
/// an infinite timeout is used.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The kernel will internally duplicate the handle, so it is safe for the application to close the handle when waits are no longer
|
||||
/// needed. Providing an event handle value of NULL simply clears any existing value. Setting a value of INVALID_HANDLE_VALUE raises
|
||||
/// an error, as will any other invalid handle value, to aid in detecting code bugs early.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// There is, at most, one event handle associated with an HIORING, attempting to set a second one will replace any that already exists.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/ioringapi/nf-ioringapi-setioringcompletionevent
|
||||
// HRESULT SetIoRingCompletionEvent( HIORING ioRing, HANDLE hEvent );
|
||||
[PInvokeData("ioringapi.h", MSDNShortId = "NF:ioringapi.SetIoRingCompletionEvent")]
|
||||
[DllImport(Lib.KernelBase, SetLastError = false, ExactSpelling = true)]
|
||||
public static extern HRESULT SetIoRingCompletionEvent(HIORING ioRing, HEVENT hEvent);
|
||||
|
||||
/// <summary>
|
||||
/// Submits all constructed but not yet submitted entries to the kernel’s queue and optionally waits for a set of operations to complete.
|
||||
/// </summary>
|
||||
|
|
|
@ -12,7 +12,7 @@ public static partial class Qwave
|
|||
/// </summary>
|
||||
public const ulong QOS_OUTGOING_DEFAULT_MINIMUM_BANDWIDTH = 0xFFFFFFFF;
|
||||
|
||||
/// <summary>Flags used by <see cref="QOSAddSocketToFlow"/>.</summary>
|
||||
/// <summary>Flags used by <see cref="QOSAddSocketToFlow(HQOS, SOCKET, SOCKADDR, QOS_TRAFFIC_TYPE, QOS_FLOW_TYPE, ref QOS_FLOWID)"/>.</summary>
|
||||
[PInvokeData("qos2.h")]
|
||||
public enum QOS_FLOW_TYPE
|
||||
{
|
||||
|
|
|
@ -5927,6 +5927,111 @@ namespace Vanara.PInvoke
|
|||
[PInvokeData("winuser.h", MSDNShortId = "")]
|
||||
public static extern HWND SetActiveWindow(HWND hWnd);
|
||||
|
||||
/// <summary>
|
||||
/// <note type="warning"><c>SetAdditionalForegroundBoostProcesses</c> is a <c>limited access feature</c>. Contact
|
||||
/// foregroundboostprocs@microsoft.com for more information.</note>
|
||||
/// <para>
|
||||
/// SetAdditionalForegroundBoostProcesses is a performance assist API to help applications with a multi-process application model
|
||||
/// where multiple processes contribute to a foreground experience, either as data or rendering. Examples include browsers (with the
|
||||
/// browser manager or frame, tabs, plugins, etc. hosted in different processes) and IDEs (which spawn processes for compilation and
|
||||
/// other tasks).
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Applications can use this API to provide a foreground priority boost to worker processes that help support the main application.
|
||||
/// Such applications can have a uniform priority boost applied to all of their constituent processes when the application's top
|
||||
/// level window is in the foreground.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="topLevelWindow">A handle to the top level window (HWND) of the application.</param>
|
||||
/// <param name="processHandleCount">
|
||||
/// The number of process handles in <c>processHandleArray</c>. This function can be called at a single time with a maximum of 32
|
||||
/// handles. Set this parameter to <c>0</c> along with setting <c>processHandleArray</c> to <c>NULL</c> to clear a prior boost configuration.
|
||||
/// </param>
|
||||
/// <param name="processHandleArray">
|
||||
/// A group of process handles to be foreground boosted or de-boosted. Set this parameter to <c>NULL</c> along with setting
|
||||
/// <c>processHandleCount</c> to <c>0</c> to clear a prior boost configuration.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// Returns <c>TRUE</c> if the call succeeds in boosting the application, <c>FALSE</c> otherwise.
|
||||
/// <c>SetAdditionalForegroundBoostProcesses</c> sets the last error code, so the application can call GetLastError() to obtain
|
||||
/// extended information if the call failed (for example, ERROR_INVALID_PARAMETER, ERROR_NOT_ENOUGH_MEMORY, or ERROR_ACCESS_DENIED).
|
||||
/// </returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This function takes a group of process handles that all get foreground boosted or de-boosted when the passed-in top level HWND
|
||||
/// moves to the foreground or background respectively. Whenever the passed-in top level HWND becomes the foreground window, a
|
||||
/// foreground boost will also be applied to the processes passed in the handle array. A similar de-boost happens when the top level
|
||||
/// HWND moves to the background.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The top level HWND passed to this function must be owned by the calling process. The calling process should have the
|
||||
/// <c>PROCESS_SET_INFORMATION</c> access right on the process handles in the <c>processHandleArray</c> - in other words, you must
|
||||
/// have full control of every window in your process. If some external component injects a window that takes foreground, or if a
|
||||
/// dialog box appears, then you lose your boost.
|
||||
/// </para>
|
||||
/// <para>If you have two top level windows, you need to call this function for each one.</para>
|
||||
/// <para>
|
||||
/// If the passed-in top level HWND is already in the foreground when <c>SetAdditionalForegroundBoostProcesses</c> is called, all of
|
||||
/// the processes in the <c>processHandleArray</c> are immediately boosted.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// A process whose handle is in the <c>processHandleArray</c> will get a foreground boost only when the top level HWND becomes the
|
||||
/// foreground window.
|
||||
/// </para>
|
||||
/// <para>Additional foreground boost is applied only when:</para>
|
||||
/// <list type="number">
|
||||
/// <item>
|
||||
/// <term>The foreground window changes, or</term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>
|
||||
/// If this function is called while the window is in the foreground and the new list has the process handle, or the list does not
|
||||
/// include the process handle while it was previously included.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// <para>
|
||||
/// When the process owning the top level HWND exits or terminates, the additional boosting relationship is torn down and secondary
|
||||
/// processes do not receive any additional foreground boosting.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The primary process's top level HWND will continue to hold references to secondary processes until either the primary process's
|
||||
/// top level HWND clears its grouped boost state, or the HWND is destroyed.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <para>
|
||||
/// In this simple scenario, the application sets up its foreground process boost configuration when the top level window is created.
|
||||
/// When WM_CREATE is handled, the function is called with handles in the lParam and the count of handles in the wParam. These
|
||||
/// processes will get foreground or background priority boosted as m_AppWindow moves in and out of being the foreground window. If
|
||||
/// the m_AppWindow is the foreground window when the function is called, the processes will also get an immediate foreground
|
||||
/// priority boost.
|
||||
/// </para>
|
||||
/// <code language="cpp"><![CDATA[case WM_CREATE:
|
||||
///
|
||||
/// //
|
||||
/// // Configure the passed in worker processes (handles) in lParam, to get foreground priority boost when m_AppWindow moves in and
|
||||
/// // out of the foreground.
|
||||
/// //
|
||||
///
|
||||
/// HANDLE* pMyHandles = retinterpret_cast<HANDLE*>(lParam);
|
||||
/// DWORD cHandles = reinterpret_cast<DWORD>(wParam);
|
||||
///
|
||||
/// if (!SetAdditionalForegroundBoostProcesses(m_AppWindow, cHandles, pMyHandles))
|
||||
/// {
|
||||
/// printf(“SetAdditionalForegroundBoostProcesses() setup failed with error code: % d\n”, GetLastError());
|
||||
/// }
|
||||
///
|
||||
/// break;]]></code>
|
||||
/// </example>
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setadditionalforegroundboostprocesses
|
||||
// BOOL SetAdditionalForegroundBoostProcesses( HWND topLevelWindow, DWORD processHandleCount, HANDLE *processHandleArray );
|
||||
[PInvokeData("Winuser.h", MSDNShortId = "NF:winuser.SetAdditionalForegroundBoostProcesses", MinClient = PInvokeClient.Windows11)]
|
||||
[DllImport(Lib.User32, SetLastError = true, ExactSpelling = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool SetAdditionalForegroundBoostProcesses(HWND topLevelWindow, uint processHandleCount,
|
||||
[Optional, In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] HPROCESS[] processHandleArray);
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Sets the mouse capture to the specified window belonging to the current thread. <c>SetCapture</c> captures mouse input either
|
||||
|
|
|
@ -47,6 +47,20 @@ namespace Vanara.PInvoke
|
|||
AR_LAPTOP = 0x80,
|
||||
}
|
||||
|
||||
/// <summary>Defines constants that indicate whether a window is registered or unregistered to receive tooltip dismiss notifications.</summary>
|
||||
/// <remarks>This enumeration is used by the RegisterForTooltipDismissNotification function.</remarks>
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/winuser/ne-winuser-tooltip_dismiss_flags
|
||||
// typedef enum { TDF_REGISTER, TDF_UNREGISTER } TOOLTIP_DISMISS_FLAGS;
|
||||
[PInvokeData("winuser.h", MSDNShortId = "NE:winuser.__unnamed_enum_2")]
|
||||
public enum TOOLTIP_DISMISS_FLAGS
|
||||
{
|
||||
/// <summary>The window is registered to receive tooltip dismiss notifications.</summary>
|
||||
TDF_REGISTER,
|
||||
|
||||
/// <summary>The window is unregistered from receiving tooltip dismiss notifications.</summary>
|
||||
TDF_UNREGISTER,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Translates a string into the OEM-defined character set.</para>
|
||||
/// <para><c>Warning</c> Do not use. See Security Considerations.</para>
|
||||
|
@ -196,6 +210,76 @@ namespace Vanara.PInvoke
|
|||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool OemToCharBuff(string lpszSrc, StringBuilder lpszDst, uint cchDstLength);
|
||||
|
||||
/// <summary>Registers or unregisters windows to receive notification to dismiss their tooltip windows.</summary>
|
||||
/// <param name="hWnd">
|
||||
/// <para>Type: <c>HWND</c></para>
|
||||
/// <para>The handle of the window to receive the <c>WM_TOOLTIPDISMISS</c> message.</para>
|
||||
/// </param>
|
||||
/// <param name="tdFlags">
|
||||
/// <para>Type: <c>TOOLTIP_DISMISS_FLAGS</c></para>
|
||||
/// <para>
|
||||
/// A value of the enumeration that specifies whether the function registers or unregisters the window. <c>TDF_REGISTER</c> to
|
||||
/// register; <c>TDF_UNREGISTER</c> to unregister.
|
||||
/// </para>
|
||||
/// </param>
|
||||
/// <returns><c>TRUE</c> if the window was successfully registered or unregistered; otherwise, <c>FALSE</c>. (See Remarks.)</returns>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This function makes tooltips more accessible by letting apps and frameworks that support tooltips register and unregister to be
|
||||
/// notified by a <c>WM_TOOLTIPDISMISS</c> message when the system requires all showing tooltips to be dismissed.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Apps should register for this notification each time they show a tooltip and hide their tooltips in response to a
|
||||
/// <c>WM_TOOLTIPDISMISS</c> message. When a tooltip is hidden for some other reason, like a mouse action, the app should unregister.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// System-defined triggers for tooltip dismissal include a solitary Ctrl key up or Ctrl+Shift+F10. (The set of triggers may change
|
||||
/// over time.)
|
||||
/// </para>
|
||||
/// <para>The function takes either the <c>HWND</c> of a tooltip window or the <c>HWND</c> of an app window that has child tooltips.</para>
|
||||
/// <list type="bullet">
|
||||
/// <item>
|
||||
/// <term>
|
||||
/// If a tooltip <c>HWND</c> itself is registered, the tooltip window is expected to register upon showing and to dismiss upon
|
||||
/// receiving a <c>WM_TOOLTIPDISMISS</c> message.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// <item>
|
||||
/// <term>
|
||||
/// If an app <c>HWND</c> registers on behalf of its tooltips, the app's window is expected to register upon showing tooltips and
|
||||
/// dismiss all of its tooltips upon receiving a <c>WM_TOOLTIPDISMISS</c> message.
|
||||
/// </term>
|
||||
/// </item>
|
||||
/// </list>
|
||||
/// <para>
|
||||
/// Tooltip or app windows are expected to call the function to register each time tooltips are shown. Registered windows are
|
||||
/// automatically unregistered upon posting <c>WM_TOOLTIPDISMISS</c>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The <c>TDF_UNREGISTER</c> flag is used to explicitly unregister a window when a tooltip window is dismissed by application or
|
||||
/// framework prerogative (such as moving the cursor out of the "safe zone"). If an app or framework calls with <c>TDF_UNREGISTER</c>
|
||||
/// after the window has been automatically unregistered, the function returns <c>FALSE</c>. There is no impact on future registrations.
|
||||
/// </para>
|
||||
/// <para>Return values</para>
|
||||
/// <para>The HWND passed into the function must be owned by the calling process; otherwise, the function returns <c>FALSE</c>.</para>
|
||||
/// <para>
|
||||
/// When called with <c>TDF_REGISTER</c> and a window belonging to the calling process, the function returns <c>TRUE</c> if the
|
||||
/// window was successfully registered or <c>FALSE</c> if the window was already registered. The window is treated as registered
|
||||
/// either way.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// When called with <c>TDF_UNREGISTER</c> and a windows belonging to the calling process, the function returns <c>TRUE</c> if the
|
||||
/// window is successfully unregistered, or <c>FALSE</c> if the windows was not currently registered. The window is treated as
|
||||
/// unregistered either way.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerfortooltipdismissnotification?view=vs-2019
|
||||
// BOOL RegisterForTooltipDismissNotification( HWND hWnd, TOOLTIP_DISMISS_FLAGS tdFlags );
|
||||
[PInvokeData("winuser.h", MSDNShortId = "NF:winuser.RegisterForTooltipDismissNotification")]
|
||||
[DllImport(Lib.User32, SetLastError = false, ExactSpelling = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool RegisterForTooltipDismissNotification(HWND hWnd, TOOLTIP_DISMISS_FLAGS tdFlags);
|
||||
|
||||
/// <summary>
|
||||
/// <para>Sets the last-error code.</para>
|
||||
/// <para>Currently, this function is identical to the SetLastError function. The second parameter is ignored.</para>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1800,6 +1800,40 @@ namespace Vanara.PInvoke
|
|||
WINHTTP_PROTOCOL_FLAG_HTTP3 = 0x2,
|
||||
}
|
||||
|
||||
/// <summary>Defines constants that specify proxy settings types for extended proxy settings APIs.</summary>
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/winhttp/ne-winhttp-winhttp_proxy_settings_type typedef enum
|
||||
// _WINHTTP_PROXY_SETTINGS_TYPE { WinHttpProxySettingsTypeUnknown, WinHttpProxySettingsTypeWsl, WinHttpProxySettingsTypeWsa }
|
||||
// WINHTTP_PROXY_SETTINGS_TYPE, *PWINHTTP_PROXY_SETTINGS_TYPE;
|
||||
[PInvokeData("winhttp.h", MSDNShortId = "NE:winhttp._WINHTTP_PROXY_SETTINGS_TYPE")]
|
||||
public enum WINHTTP_PROXY_SETTINGS_TYPE
|
||||
{
|
||||
/// <summary>Specifies an unknown type.</summary>
|
||||
WinHttpProxySettingsTypeUnknown,
|
||||
|
||||
/// <summary>Specifies settings for Windows Subsystem for Linux (WSL).</summary>
|
||||
WinHttpProxySettingsTypeWsl,
|
||||
|
||||
/// <summary>Specifies settings for Windows Subsystem for Android (WSA).</summary>
|
||||
WinHttpProxySettingsTypeWsa,
|
||||
}
|
||||
|
||||
/// <summary></summary>
|
||||
[Flags]
|
||||
public enum WINHTTP_PROXY_TYPE : ulong
|
||||
{
|
||||
/// <summary>Direct to net</summary>
|
||||
WINHTTP_PROXY_TYPE_DIRECT = 0x00000001,
|
||||
|
||||
/// <summary>Via named proxy</summary>
|
||||
WINHTTP_PROXY_TYPE_PROXY = 0x00000002,
|
||||
|
||||
/// <summary>Autoproxy URL</summary>
|
||||
WINHTTP_PROXY_TYPE_AUTO_PROXY_URL = 0x00000004,
|
||||
|
||||
/// <summary>Use autoproxy detection</summary>
|
||||
WINHTTP_PROXY_TYPE_AUTO_DETECT = 0x00000008,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>These attributes and modifiers are used by WinHttpQueryHeaders.</para>
|
||||
/// <para>
|
||||
|
|
Loading…
Reference in New Issue