// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436
namespace Windows.Win32
{
    using global::System;
    using global::System.Diagnostics;
    using global::System.Runtime.CompilerServices;
    using global::System.Runtime.InteropServices;
    using winmdroot = global::Windows.Win32;

    /// <content>
    /// Contains extern methods from "User32.dll".
    /// </content>
    internal static partial class PInvoke
    {
        /// <summary>Changes an attribute of the specified window.</summary>
        /// <param name="hWnd">
        /// <para>Type: <b>HWND</b> A handle to the window and, indirectly, the class to which the window belongs. The <b>SetWindowLongPtr</b> function fails if the process that owns the window specified by the <i>hWnd</i> parameter is at a higher process privilege in the UIPI hierarchy than the process the calling thread resides in. <b>Windows XP/2000:  </b> The <b>SetWindowLongPtr</b> function fails if the window specified by the <i>hWnd</i> parameter does not belong to the same process as the calling thread.</para>
        /// <para><see href="https://docs.microsoft.com/windows/win32/api//winuser/nf-winuser-setwindowlongptrw#parameters">Read more on docs.microsoft.com</see>.</para>
        /// </param>
        /// <param name="nIndex">Type: <b>int</b></param>
        /// <param name="dwNewLong">
        /// <para>Type: <b>LONG_PTR</b> The replacement value.</para>
        /// <para><see href="https://docs.microsoft.com/windows/win32/api//winuser/nf-winuser-setwindowlongptrw#parameters">Read more on docs.microsoft.com</see>.</para>
        /// </param>
        /// <returns>
        /// <para>Type: <b>LONG_PTR</b> If the function succeeds, the return value is the previous value of the specified offset. If the function fails, the return value is zero. To get extended error information, call <a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling <a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-setlasterror">SetLastError</a> with 0, then call <b>SetWindowLongPtr</b>. Function failure will be indicated by a return value of zero and a <a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a> result that is nonzero.</para>
        /// </returns>
        /// <remarks>
        /// <para><see href="https://docs.microsoft.com/windows/win32/api//winuser/nf-winuser-setwindowlongptrw">Learn more about this API from docs.microsoft.com</see>.</para>
        /// </remarks>
        [DllImport("User32", ExactSpelling = true, EntryPoint = "SetWindowLongPtrW", SetLastError = true)]
        [DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
#if NET5_0_OR_GREATER
        [global::System.Runtime.Versioning.SupportedOSPlatform("windows5.0")]
#endif
        internal static extern nint SetWindowLongPtr(winmdroot.Foundation.HWND hWnd, winmdroot.UI.WindowsAndMessaging.WINDOW_LONG_PTR_INDEX nIndex, nint dwNewLong);

        /// <summary>Retrieves information about the specified window. The function also retrieves the value at a specified offset into the extra window memory.</summary>
        /// <param name="hWnd">
        /// <para>Type: <b>HWND</b> A handle to the window and, indirectly, the class to which the window belongs.</para>
        /// <para><see href="https://docs.microsoft.com/windows/win32/api//winuser/nf-winuser-getwindowlongptrw#parameters">Read more on docs.microsoft.com</see>.</para>
        /// </param>
        /// <param name="nIndex">Type: <b>int</b></param>
        /// <returns>
        /// <para>Type: <b>LONG_PTR</b> If the function succeeds, the return value is the requested value. If the function fails, the return value is zero. To get extended error information, call <a href="/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>. If <a href="/windows/desktop/api/winuser/nf-winuser-setwindowlonga">SetWindowLong</a> or <a href="/windows/desktop/api/winuser/nf-winuser-setwindowlongptra">SetWindowLongPtr</a> has not been called previously, <b>GetWindowLongPtr</b> returns zero for values in the extra window or class memory.</para>
        /// </returns>
        /// <remarks>
        /// <para><see href="https://docs.microsoft.com/windows/win32/api//winuser/nf-winuser-getwindowlongptrw">Learn more about this API from docs.microsoft.com</see>.</para>
        /// </remarks>
        [DllImport("User32", ExactSpelling = true, EntryPoint = "GetWindowLongPtrW", SetLastError = true)]
        [DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
#if NET5_0_OR_GREATER
        [global::System.Runtime.Versioning.SupportedOSPlatform("windows5.0")]
#endif
        internal static extern nint GetWindowLongPtr(winmdroot.Foundation.HWND hWnd, winmdroot.UI.WindowsAndMessaging.WINDOW_LONG_PTR_INDEX nIndex);
    }
}
