|
// ------------------------------------------------------------------------------
// <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,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
/// <content>
/// Contains extern methods from "USER32.dll".
/// </content>
internal static partial class PInvoke
{
/// <summary>Determines which pop-up window owned by the specified window was most recently active.</summary>
/// <param name="hWnd">
/// <para>Type: <b>HWND</b> A handle to the owner window.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getlastactivepopup#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HWND</b> The return value identifies the most recently active pop-up window. The return value is the same as the <i>hWnd</i> parameter, if any of the following conditions are met: </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getlastactivepopup">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("USER32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
internal static extern winmdroot.Foundation.HWND GetLastActivePopup(winmdroot.Foundation.HWND hWnd);
/// <summary>Determines the visibility state of the specified window.</summary>
/// <param name="hWnd">
/// <para>Type: <b>HWND</b> A handle to the window to be tested.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-iswindowvisible#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>BOOL</b> If the specified window, its parent window, its parent's parent window, and so forth, have the <b>WS_VISIBLE</b> style, the return value is nonzero. Otherwise, the return value is zero. Because the return value specifies whether the window has the <b>WS_VISIBLE</b> style, it may be nonzero even if the window is totally obscured by other windows.</para>
/// </returns>
/// <remarks>
/// <para>The visibility state of a window is indicated by the <b>WS_VISIBLE</b> style bit. When <b>WS_VISIBLE</b> is set, the window is displayed and subsequent drawing into it is displayed as long as the window has the <b>WS_VISIBLE</b> style. Any drawing to a window with the <b>WS_VISIBLE</b> style will not be displayed if the window is obscured by other windows or is clipped by its parent window.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-iswindowvisible#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("USER32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
internal static extern winmdroot.Foundation.BOOL IsWindowVisible(winmdroot.Foundation.HWND hWnd);
/// <summary>Brings the thread that created the specified window into the foreground and activates the window.</summary>
/// <param name="hWnd">
/// <para>Type: <b>HWND</b> A handle to the window that should be activated and brought to the foreground.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setforegroundwindow#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>BOOL</b> If the window was brought to the foreground, the return value is nonzero. If the window was not brought to the foreground, the return value is zero.</para>
/// </returns>
/// <remarks>
/// <para>The system restricts which processes can set the foreground window. A process can set the foreground window by calling **SetForegroundWindow** only if: - All of the following conditions are true: - The calling process belongs to a desktop application, not a UWP app or a Windows Store app designed for Windows 8 or 8.1. - The foreground process has not disabled calls to **SetForegroundWindow** by a previous call to the [**LockSetForegroundWindow**](nf-winuser-locksetforegroundwindow.md) function. - The foreground lock time-out has expired (see [**SPI_GETFOREGROUNDLOCKTIMEOUT** in **SystemParametersInfo**](nf-winuser-systemparametersinfoa.md#SPI_GETFOREGROUNDLOCKTIMEOUT)). - No menus are active. - Additionally, at least one of the following conditions is true: - The calling process is the foreground process. - The calling process was started by the foreground process. - There is currently no foreground window, and thus no foreground process. - The calling process received the last input event. - Either the foreground process or the calling process is being debugged. It is possible for a process to be denied the right to set the foreground window even if it meets these conditions. An application cannot force a window to the foreground while the user is working with another window. Instead, Windows flashes the taskbar button of the window to notify the user. A process that can set the foreground window can enable another process to set the foreground window by calling the [**AllowSetForegroundWindow**](nf-winuser-allowsetforegroundwindow.md) function. The process specified by the *dwProcessId* parameter to **AllowSetForegroundWindow** loses the ability to set the foreground window the next time that either the user generates input, unless the input is directed at that process, or the next time a process calls **AllowSetForegroundWindow**, unless the same process is specified as in the previous call to **AllowSetForegroundWindow**. The foreground process can disable calls to <b>SetForegroundWindow</b> by calling the [**LockSetForegroundWindow**](nf-winuser-locksetforegroundwindow.md) function.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setforegroundwindow#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("USER32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
internal static extern winmdroot.Foundation.BOOL SetForegroundWindow(winmdroot.Foundation.HWND hWnd);
/// <summary>Changes the size, position, and Z order of a child, pop-up, or top-level window. These windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.</summary>
/// <param name="hWnd">
/// <para>Type: <b>HWND</b> A handle to the window.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="hWndInsertAfter">Type: <b>HWND</b></param>
/// <param name="X">
/// <para>Type: <b>int</b> The new position of the left side of the window, in client coordinates.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="Y">
/// <para>Type: <b>int</b> The new position of the top of the window, in client coordinates.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cx">
/// <para>Type: <b>int</b> The new width of the window, in pixels.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cy">
/// <para>Type: <b>int</b> The new height of the window, in pixels.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="uFlags">Type: <b>UINT</b></param>
/// <returns>
/// <para>Type: <b>BOOL</b> If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
/// </returns>
/// <remarks>
/// <para>As part of the Vista re-architecture, all services were moved off the interactive desktop into Session 0. hwnd and window manager operations are only effective inside a session and cross-session attempts to manipulate the hwnd will fail. For more information, see <a href="https://docs.microsoft.com/previous-versions/aa480152(v=msdn.10)">The Windows Vista Developer Story: Application Compatibility Cookbook</a>. If you have changed certain window data using <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-setwindowlonga">SetWindowLong</a>, you must call <b>SetWindowPos</b> for the changes to take effect. Use the following combination for <i>uFlags</i>: <c>SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED</c>. A window can be made a topmost window either by setting the <i>hWndInsertAfter</i> parameter to <b>HWND_TOPMOST</b> and ensuring that the <b>SWP_NOZORDER</b> flag is not set, or by setting a window's position in the Z order so that it is above any existing topmost windows. When a non-topmost window is made topmost, its owned windows are also made topmost. Its owners, however, are not changed. If neither the <b>SWP_NOACTIVATE</b> nor <b>SWP_NOZORDER</b> flag is specified (that is, when the application requests that a window be simultaneously activated and its position in the Z order changed), the value specified in <i>hWndInsertAfter</i> is used only in the following circumstances. </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("USER32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
internal static extern winmdroot.Foundation.BOOL SetWindowPos(winmdroot.Foundation.HWND hWnd, winmdroot.Foundation.HWND hWndInsertAfter, int X, int Y, int cx, int cy, winmdroot.UI.WindowsAndMessaging.SET_WINDOW_POS_FLAGS uFlags);
/// <summary>Switches focus to the specified window and brings it to the foreground.</summary>
/// <param name="hwnd">
/// <para>Type: <b>HWND</b> A handle to the window.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-switchtothiswindow#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="fUnknown">
/// <para>Type: <b>BOOL</b> A <b>TRUE</b> for this parameter indicates that the window is being switched to using the Alt/Ctl+Tab key sequence. This parameter should be <b>FALSE</b> otherwise.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-switchtothiswindow#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <remarks>
/// <para>This function is typically called to maintain window z-ordering. This function was not included in the SDK headers and libraries until Windows XP with Service Pack 1 (SP1) and Windows Server 2003. If you do not have a header file and import library for this function, you can call the function using <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadlibrarya">LoadLibrary</a> and <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-getprocaddress">GetProcAddress</a>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-switchtothiswindow#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("USER32.dll", ExactSpelling = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
internal static extern void SwitchToThisWindow(winmdroot.Foundation.HWND hwnd, winmdroot.Foundation.BOOL fUnknown);
}
}
|