[SuppressMessage("Interoperability", "CA1401:P/Invokes should not be visible", Justification = "We want plugins to share this NativeMethods class, instead of each one creating its own.")]
[SuppressMessage("StyleCop.CSharp.NamingRules", "SA1310:Field names should not contain underscore", Justification = "These are the names used by win32.")]
publicstaticclassWin32Constants
{
/// <summary>
/// GetWindowLong index to retrieves the extended window styles.
/// </summary>
publicconstintGWL_EXSTYLE=-20;
/// <summary>
/// A window receives this message when the user chooses a command from the Window menu (formerly known as the system or control menu)
/// or when the user chooses the maximize button, minimize button, restore button, or close button.
/// </summary>
publicconstintWM_SYSCOMMAND=0x0112;
/// <summary>
/// Restores the window to its normal position and size.
/// Some flags for interop calls to SetWindowPosition
/// </summary>
[Flags]
publicenumSetWindowPosFlags:uint
{
/// <summary>
/// If the calling thread and the thread that owns the window are attached to different input queues, the system posts the request to the thread that owns the window. This prevents the calling thread from blocking its execution while other threads process the request.
/// </summary>
SWP_ASYNCWINDOWPOS=0x4000,
/// <summary>
/// Prevents generation of the WM_SYNCPAINT message.
/// </summary>
SWP_DEFERERASE=0x2000,
/// <summary>
/// Draws a frame (defined in the window's class description) around the window.
/// </summary>
SWP_DRAWFRAME=0x0020,
/// <summary>
/// Applies new frame styles set using the SetWindowLong function. Sends a WM_NCCALCSIZE message to the window, even if the window's size is not being changed. If this flag is not specified, WM_NCCALCSIZE is sent only when the window's size is being changed.
/// </summary>
SWP_FRAMECHANGED=0x0020,
/// <summary>
/// Hides the window.
/// </summary>
SWP_HIDEWINDOW=0x0080,
/// <summary>
/// Does not activate the window. If this flag is not set, the window is activated and moved to the top of either the topmost or non-topmost group (depending on the setting of the hWndInsertAfter parameter).
/// </summary>
SWP_NOACTIVATE=0x0010,
/// <summary>
/// Discards the entire contents of the client area. If this flag is not specified, the valid contents of the client area are saved and copied back into the client area after the window is sized or repositioned.
/// </summary>
SWP_NOCOPYBITS=0x0100,
/// <summary>
/// Retains the current position (ignores X and Y parameters).
/// </summary>
SWP_NOMOVE=0x0002,
/// <summary>
/// Does not change the owner window's position in the Z order.
/// </summary>
SWP_NOOWNERZORDER=0x0200,
/// <summary>
/// Does not redraw changes. If this flag is set, no repainting of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent window uncovered as a result of the window being moved. When this flag is set, the application must explicitly invalidate or redraw any parts of the window and parent window that need redrawing.
/// </summary>
SWP_NOREDRAW=0x0008,
/// <summary>
/// Same as the SWP_NOOWNERZORDER flag.
/// </summary>
SWP_NOREPOSITION=0x0200,
/// <summary>
/// Prevents the window from receiving the WM_WINDOWPOSCHANGING message.
/// </summary>
SWP_NOSENDCHANGING=0x0400,
/// <summary>
/// Retains the current size (ignores the cx and cy parameters).
/// </summary>
SWP_NOSIZE=0x0001,
/// <summary>
/// Retains the current Z order (ignores the hWndInsertAfter parameter).
/// </summary>
SWP_NOZORDER=0x0004,
/// <summary>
/// Displays the window.
/// </summary>
SWP_SHOWWINDOW=0x0040,
}
/// <summary>
/// Options for DwmpActivateLivePreview
/// </summary>
publicenumLivePreviewTrigger
{
/// <summary>
/// Show Desktop button
/// </summary>
ShowDesktop=1,
/// <summary>
/// WIN+SPACE hotkey
/// </summary>
WinSpace,
/// <summary>
/// Hover-over Superbar thumbnails
/// </summary>
Superbar,
/// <summary>
/// Alt-Tab
/// </summary>
AltTab,
/// <summary>
/// Press and hold on Superbar thumbnails
/// </summary>
SuperbarTouch,
/// <summary>
/// Press and hold on Show desktop
/// </summary>
ShowDesktopTouch,
}
/// <summary>
/// Show Window Enums
/// </summary>
publicenumShowWindowCommand
{
/// <summary>
/// Hides the window and activates another window.
/// </summary>
Hide=0,
/// <summary>
/// Activates and displays a window. If the window is minimized or
/// maximized, the system restores it to its original size and position.
/// An application should specify this flag when displaying the window
/// for the first time.
/// </summary>
Normal=1,
/// <summary>
/// Activates the window and displays it as a minimized window.
/// </summary>
ShowMinimized=2,
/// <summary>
/// Maximizes the specified window.
/// </summary>
Maximize=3,// is this the right value?
/// <summary>
/// Activates the window and displays it as a maximized window.
/// </summary>
ShowMaximized=3,
/// <summary>
/// Displays a window in its most recent size and position. This value
/// is similar to <see cref="Win32.ShowWindowCommand.Normal"/>, except
/// the window is not activated.
/// </summary>
ShowNoActivate=4,
/// <summary>
/// Activates the window and displays it in its current size and position.
/// </summary>
Show=5,
/// <summary>
/// Minimizes the specified window and activates the next top-level
/// window in the Z order.
/// </summary>
Minimize=6,
/// <summary>
/// Displays the window as a minimized window. This value is similar to
/// <see cref="Win32.ShowWindowCommand.ShowMinimized"/>, except the
/// window is not activated.
/// </summary>
ShowMinNoActive=7,
/// <summary>
/// Displays the window in its current size and position. This value is
/// similar to <see cref="Win32.ShowWindowCommand.Show"/>, except the
/// window is not activated.
/// </summary>
ShowNA=8,
/// <summary>
/// Activates and displays the window. If the window is minimized or
/// maximized, the system restores it to its original size and position.
/// An application should specify this flag when restoring a minimized window.
/// </summary>
Restore=9,
/// <summary>
/// Sets the show state based on the SW_* value specified in the
/// STARTUPINFO structure passed to the CreateProcess function by the
/// program that started the application.
/// </summary>
ShowDefault=10,
/// <summary>
/// <b>Windows 2000/XP:</b> Minimizes a window, even if the thread
/// that owns the window is not responding. This flag should only be
/// used when minimizing windows from a different thread.
/// </summary>
ForceMinimize=11,
}
/// <summary>
/// The rendering policy to use for set window attribute
/// </summary>
[Flags]
publicenumDwmNCRenderingPolicies
{
UseWindowStyle,
Disabled,
Enabled,
Last,
}
/// <summary>
/// DWM window attribute (Windows 7 and earlier: The values between ExcludedFromPeek and Last aren't supported.)
/// </summary>
[Flags]
publicenumDwmWindowAttributes
{
NCRenderingEnabled=1,
NCRenderingPolicy,
TransitionsForceDisabled,
AllowNCPaint,
CaptionButtonBounds,
NonClientRtlLayout,
ForceIconicRepresentation,
Flip3DPolicy,
ExtendedFrameBounds,
HasIconicBitmap,
DisallowPeek,
ExcludedFromPeek,
Cloak,
Cloaked,
FreezeRepresentation,
PassiveUpdateMode,
UseHostbackdropbrush,
UseImmersiveDarkMode,
WindowCornerPreference,
BorderColor,
CaptionColor,
TextColor,
VisibleFrameBorderThickness,
Last,
}
/// <summary>
/// Flags for describing the window cloak state (Windows 7 and earlier: This value is not supported.)
/// </summary>
[Flags]
publicenumDwmWindowCloakStates
{
None=0,
CloakedApp=1,
CloakedShell=2,
CloakedInherited=4,
}
/// <summary>
/// Flags for accessing the process in trying to get icon for the process
/// </summary>
[Flags]
publicenumProcessAccessFlags
{
/// <summary>
/// Required to create a thread.
/// </summary>
CreateThread=0x0002,
/// <summary>
/// Required to set the session id for a process.
/// </summary>
SetSessionId=0x0004,
/// <summary>
/// Required to perform an operation on the address space of a process
/// </summary>
VmOperation=0x0008,
/// <summary>
/// Required to read memory in a process using ReadProcessMemory.
/// </summary>
VmRead=0x0010,
/// <summary>
/// Required to write to memory in a process using WriteProcessMemory.
/// </summary>
VmWrite=0x0020,
/// <summary>
/// Required to duplicate a handle using DuplicateHandle.
/// </summary>
DupHandle=0x0040,
/// <summary>
/// Required to create a process.
/// </summary>
CreateProcess=0x0080,
/// <summary>
/// Required to set memory limits using SetProcessWorkingSetSize.
/// </summary>
SetQuota=0x0100,
/// <summary>
/// Required to set certain information about a process, such as its priority class (see SetPriorityClass).
/// </summary>
SetInformation=0x0200,
/// <summary>
/// Required to retrieve certain information about a process, such as its token, exit code, and priority class (see OpenProcessToken).
/// </summary>
QueryInformation=0x0400,
/// <summary>
/// Required to suspend or resume a process.
/// </summary>
SuspendResume=0x0800,
/// <summary>
/// Required to retrieve certain information about a process (see GetExitCodeProcess, GetPriorityClass, IsProcessInJob, QueryFullProcessImageName).
/// A handle that has the PROCESS_QUERY_INFORMATION access right is automatically granted PROCESS_QUERY_LIMITED_INFORMATION.
/// </summary>
QueryLimitedInformation=0x1000,
/// <summary>
/// Required to wait for the process to terminate using the wait functions.
/// </summary>
Synchronize=0x100000,
/// <summary>
/// Required to delete the object.
/// </summary>
Delete=0x00010000,
/// <summary>
/// Required to read information in the security descriptor for the object, not including the information in the SACL.
/// To read or write the SACL, you must request the ACCESS_SYSTEM_SECURITY access right. For more information, see SACL Access Right.
/// </summary>
ReadControl=0x00020000,
/// <summary>
/// Required to modify the DACL in the security descriptor for the object.
/// </summary>
WriteDac=0x00040000,
/// <summary>
/// Required to change the owner in the security descriptor for the object.
/// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT).
/// <para>
/// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly.
/// </para>
/// </summary>
publicintLength;
/// <summary>
/// Specifies flags that control the position of the minimized window and the method by which the window is restored.
/// </summary>
publicintFlags;
/// <summary>
/// The current show state of the window.
/// </summary>
publicShowWindowCommandShowCmd;
/// <summary>
/// The coordinates of the window's upper-left corner when the window is minimized.
/// </summary>
publicPOINTMinPosition;
/// <summary>
/// The coordinates of the window's upper-left corner when the window is maximized.
/// </summary>
publicPOINTMaxPosition;
/// <summary>
/// The window's coordinates when the window is in the restored position.