Restore SEBPatch
This commit is contained in:
34
SafeExamBrowser.WindowsApi/Constants/AccessMask.cs
Normal file
34
SafeExamBrowser.WindowsApi/Constants/AccessMask.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See https://docs.microsoft.com/de-de/windows/desktop/SecAuthZ/access-mask
|
||||
/// </remarks>
|
||||
[Flags]
|
||||
internal enum AccessMask : uint
|
||||
{
|
||||
DESKTOP_NONE = 0,
|
||||
DESKTOP_READOBJECTS = 0x0001,
|
||||
DESKTOP_CREATEWINDOW = 0x0002,
|
||||
DESKTOP_CREATEMENU = 0x0004,
|
||||
DESKTOP_HOOKCONTROL = 0x0008,
|
||||
DESKTOP_JOURNALRECORD = 0x0010,
|
||||
DESKTOP_JOURNALPLAYBACK = 0x0020,
|
||||
DESKTOP_ENUMERATE = 0x0040,
|
||||
DESKTOP_WRITEOBJECTS = 0x0080,
|
||||
DESKTOP_SWITCHDESKTOP = 0x0100,
|
||||
|
||||
GENERIC_ALL = (DESKTOP_READOBJECTS | DESKTOP_CREATEWINDOW | DESKTOP_CREATEMENU | DESKTOP_HOOKCONTROL | DESKTOP_JOURNALRECORD
|
||||
| DESKTOP_JOURNALPLAYBACK | DESKTOP_ENUMERATE | DESKTOP_WRITEOBJECTS | DESKTOP_SWITCHDESKTOP
|
||||
| Constant.STANDARD_RIGHTS_REQUIRED)
|
||||
}
|
||||
}
|
244
SafeExamBrowser.WindowsApi/Constants/Constant.cs
Normal file
244
SafeExamBrowser.WindowsApi/Constants/Constant.cs
Normal file
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
internal static class Constant
|
||||
{
|
||||
/// <summary>
|
||||
/// A window has received mouse capture. This event is sent by the system, never by servers.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd318066(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const uint EVENT_SYSTEM_CAPTURESTART = 0x8;
|
||||
|
||||
/// <summary>
|
||||
/// The foreground window has changed. The system sends this event even if the foreground window has changed to another window in
|
||||
/// the same thread. Server applications never send this event.
|
||||
/// For this event, the WinEventProc callback function's hwnd parameter is the handle to the window that is in the foreground, the
|
||||
/// idObject parameter is OBJID_WINDOW, and the idChild parameter is CHILDID_SELF.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd318066(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const uint EVENT_SYSTEM_FOREGROUND = 0x3;
|
||||
|
||||
/// <summary>
|
||||
/// The large icon of a window. See https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-geticon#parameters.
|
||||
/// </summary>
|
||||
internal const int ICON_BIG = 1;
|
||||
|
||||
/// <summary>
|
||||
/// The small icon of a window. See https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-geticon#parameters.
|
||||
/// </summary>
|
||||
internal const int ICON_SMALL = 0;
|
||||
|
||||
/// <summary>
|
||||
/// The small icon of an application. If an application does not provide one, the system uses a system-generated icon for a window.
|
||||
/// See https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-geticon#parameters.
|
||||
/// </summary>
|
||||
internal const int ICON_SMALL2 = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Minimize all open windows.
|
||||
/// </summary>
|
||||
internal const int MIN_ALL = 419;
|
||||
|
||||
/// <summary>
|
||||
/// Bitmask to evaluate the origin of a mouse event.
|
||||
///
|
||||
/// See https://docs.microsoft.com/en-us/windows/desktop/tablet/system-events-and-mouse-messages.
|
||||
/// </summary>
|
||||
internal const uint MOUSEEVENTF_MASK = 0xFFFFFF00;
|
||||
|
||||
/// <summary>
|
||||
/// The constant for a mouse event generated by a touch interface.
|
||||
///
|
||||
/// See https://docs.microsoft.com/en-us/windows/desktop/tablet/system-events-and-mouse-messages.
|
||||
/// </summary>
|
||||
internal const uint MOUSEEVENTF_FROMTOUCH = 0xFF515700;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the default priority class for processes, i.e. a process with no special scheduling needs.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686219(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int NORMAL_PRIORITY_CLASS = 0x20;
|
||||
|
||||
/// <summary>
|
||||
/// Standard access rights required for a desktop.
|
||||
///
|
||||
/// See https://docs.microsoft.com/de-de/windows/desktop/SecAuthZ/standard-access-rights.
|
||||
/// </summary>
|
||||
internal const int STANDARD_RIGHTS_REQUIRED = 0xF0000;
|
||||
|
||||
/// <summary>
|
||||
/// The constant for the name of a user object.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms683238(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int UOI_NAME = 2;
|
||||
|
||||
/// <summary>
|
||||
/// The callback function is not mapped into the address space of the process that generates the event. Because the hook function
|
||||
/// is called across process boundaries, the system must queue events. Although this method is asynchronous, events are guaranteed
|
||||
/// to be in sequential order.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/dd373640(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const uint WINEVENT_OUTOFCONTEXT = 0x0;
|
||||
|
||||
/// <summary>
|
||||
/// Sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or
|
||||
/// when an accelerator keystroke is translated.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms647591(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_COMMAND = 0x111;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon
|
||||
/// in the ALT+TAB dialog, and the small icon in the window caption.
|
||||
///
|
||||
/// See https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-geticon.
|
||||
/// </summary>
|
||||
internal const int WM_GETICON = 0x7F;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when a nonsystem key is pressed. A nonsystem key is a key that is pressed when
|
||||
/// the ALT key is not pressed.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646280(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_KEYDOWN = 0x100;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when a nonsystem key is released. A nonsystem key is a key that is pressed when
|
||||
/// the ALT key is not pressed, or a keyboard key that is pressed when a window has the keyboard focus.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646281(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_KEYUP = 0x101;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the left mouse button while the cursor is in the client area of a window. If the mouse is not
|
||||
/// captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_LBUTTONDOWN = 0x201;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the left mouse button while the cursor is in the client area of a window. If the mouse is not
|
||||
/// captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms645608(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_LBUTTONUP = 0x202;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the middle mouse button while the cursor is in the client area of a window. If the mouse is not
|
||||
/// captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms645610(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_MBUTTONDOWN = 0x207;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the middle mouse button while the cursor is in the client area of a window. If the mouse is not
|
||||
/// captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms645611(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_MBUTTONUP = 0x208;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to a window when the cursor moves. If the mouse is not captured, the message is posted to the window that contains the
|
||||
/// cursor. Otherwise, the message is posted to the window that has captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms645616(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_MOUSEMOVE = 0x200;
|
||||
|
||||
/// <summary>
|
||||
/// Sent to the focus window when the mouse wheel is rotated. The DefWindowProc function propagates the message to the window's
|
||||
/// parent. There should be no internal forwarding of the message, since DefWindowProc propagates it up the parent chain until i
|
||||
/// finds a window that processes it.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms645617(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_MOUSEWHEEL = 0x20A;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the right mouse button while the cursor is in the client area of a window. If the mouse is not
|
||||
/// captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646242(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_RBUTTONDOWN = 0x204;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the right mouse button while the cursor is in the client area of a window. If the mouse is not
|
||||
/// captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646243(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_RBUTTONUP = 0x205;
|
||||
|
||||
/// <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.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_SYSCOMMAND = 0x112;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down
|
||||
/// the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the
|
||||
/// WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two
|
||||
/// contexts by checking the context code in the lParam parameter.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646286(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal const int WM_SYSKEYDOWN = 0x104;
|
||||
|
||||
/// <summary>
|
||||
/// Posted to the window with the keyboard focus when the user releases a key that was pressed while the ALT key was held down.
|
||||
/// It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYUP message is sent to the active
|
||||
/// window. The window that receives the message can distinguish between these two contexts by checking the context code in the
|
||||
/// lParam parameter.
|
||||
///
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646287(v=vs.85).aspx
|
||||
/// </summary>
|
||||
internal const int WM_SYSKEYUP = 0x105;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user presses the first or second X button while the cursor is in the client area of a window. If the mouse is
|
||||
/// not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://docs.microsoft.com/de-de/windows/desktop/inputdev/wm-xbuttondown.
|
||||
/// </summary>
|
||||
internal const int WM_XBUTTONDOWN = 0x20B;
|
||||
|
||||
/// <summary>
|
||||
/// Posted when the user releases the first or second X button while the cursor is in the client area of a window. If the mouse is
|
||||
/// not captured, the message is posted to the window beneath the cursor. Otherwise, the message is posted to the window that has
|
||||
/// captured the mouse.
|
||||
///
|
||||
/// See https://docs.microsoft.com/de-de/windows/desktop/inputdev/wm-xbuttonup.
|
||||
/// </summary>
|
||||
internal const int WM_XBUTTONUP = 0x20C;
|
||||
}
|
||||
}
|
100
SafeExamBrowser.WindowsApi/Constants/HookType.cs
Normal file
100
SafeExamBrowser.WindowsApi/Constants/HookType.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See http://www.pinvoke.net/default.aspx/Enums/HookType.html.
|
||||
/// </remarks>
|
||||
internal enum HookType
|
||||
{
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that records input messages posted to the system message queue. This hook is useful for recording
|
||||
/// macros. For more information, see the JournalRecordProc hook procedure.
|
||||
/// </summary>
|
||||
WH_JOURNALRECORD = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure. For more information,
|
||||
/// see the JournalPlaybackProc hook procedure.
|
||||
/// </summary>
|
||||
WH_JOURNALPLAYBACK = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors keystroke messages. For more information, see the KeyboardProc hook procedure.
|
||||
/// </summary>
|
||||
WH_KEYBOARD = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors messages posted to a message queue. For more information, see the GetMsgProc hook
|
||||
/// procedure.
|
||||
/// </summary>
|
||||
WH_GETMESSAGE = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors messages before the system sends them to the destination window procedure. For more
|
||||
/// information, see the CallWndProc hook procedure.
|
||||
/// </summary>
|
||||
WH_CALLWNDPROC = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that receives notifications useful to a CBT application. For more information, see the CBTProc hook
|
||||
/// procedure.
|
||||
/// </summary>
|
||||
WH_CBT = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu,
|
||||
/// or scroll bar. The hook procedure monitors these messages for all applications in the same desktop as the calling thread. For
|
||||
/// more information, see the SysMsgProc hook procedure.
|
||||
/// </summary>
|
||||
WH_SYSMSGFILTER = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors mouse messages. For more information, see the MouseProc hook procedure.
|
||||
/// </summary>
|
||||
WH_MOUSE = 7,
|
||||
|
||||
WH_HARDWARE = 8,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure useful for debugging other hook procedures. For more information, see the DebugProc hook procedure.
|
||||
/// </summary>
|
||||
WH_DEBUG = 9,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that receives notifications useful to shell applications. For more information, see the ShellProc
|
||||
/// hook procedure.
|
||||
/// </summary>
|
||||
WH_SHELL = 10,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that will be called when the application's foreground thread is about to become idle. This hook is
|
||||
/// useful for performing low priority tasks during idle time. For more information, see the ForegroundIdleProc hook procedure.
|
||||
/// </summary>
|
||||
WH_FOREGROUNDIDLE = 11,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors messages after they have been processed by the destination window procedure. For more
|
||||
/// information, see the CallWndRetProc hook procedure.
|
||||
/// </summary>
|
||||
WH_CALLWNDPROCRET = 12,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors low-level keyboard input events. For more information, see the LowLevelKeyboardProc
|
||||
/// hook procedure.
|
||||
/// </summary>
|
||||
WH_KEYBOARD_LL = 13,
|
||||
|
||||
/// <summary>
|
||||
/// Installs a hook procedure that monitors low-level mouse input events. For more information, see the LowLevelMouseProc hook
|
||||
/// procedure.
|
||||
/// </summary>
|
||||
WH_MOUSE_LL = 14
|
||||
}
|
||||
}
|
59
SafeExamBrowser.WindowsApi/Constants/SPI.cs
Normal file
59
SafeExamBrowser.WindowsApi/Constants/SPI.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow.
|
||||
/// See http://www.pinvoke.net/default.aspx/Enums/SPI.html?diff=y.
|
||||
/// </remarks>
|
||||
internal enum SPI : uint
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves the full path of the bitmap file for the desktop wallpaper. The pvParam parameter must point to a buffer
|
||||
/// that receives a null-terminated path string. Set the uiParam parameter to the size, in characters, of the pvParam buffer.
|
||||
/// The returned string will not exceed MAX_PATH characters. If there is no desktop wallpaper, the returned string is empty.
|
||||
/// </summary>
|
||||
GETDESKWALLPAPER = 0x73,
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves information about the StickyKeys accessibility feature. The pvParam parameter must point to a STICKYKEYS structure
|
||||
/// that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(STICKYKEYS).
|
||||
/// </summary>
|
||||
GETSTICKYKEYS = 0x3A,
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the size of the work area on the primary display monitor. The work area is the portion of the screen
|
||||
/// not obscured by the system taskbar or by application desktop toolbars. The pvParam parameter must point to a
|
||||
/// RECT structure that receives the coordinates of the work area, expressed in virtual screen coordinates. To get
|
||||
/// the work area of a monitor other than the primary display monitor, call the GetMonitorInfo function.
|
||||
/// </summary>
|
||||
GETWORKAREA = 0x30,
|
||||
|
||||
/// <summary>
|
||||
/// Sets the desktop wallpaper. The value of the pvParam parameter determines the new wallpaper. To specify a wallpaper bitmap,
|
||||
/// set pvParam to point to a null-terminated string containing the name of a bitmap file. Setting pvParam to "" removes the
|
||||
/// wallpaper. Setting pvParam to SETWALLPAPER_DEFAULT or null reverts to the default wallpaper.
|
||||
/// </summary>
|
||||
SETDESKWALLPAPER = 0x14,
|
||||
|
||||
/// <summary>
|
||||
/// Sets the parameters of the StickyKeys accessibility feature. The pvParam parameter must point to a STICKYKEYS structure
|
||||
/// that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(STICKYKEYS).
|
||||
/// </summary>
|
||||
SETSTICKYKEYS = 0x3B,
|
||||
|
||||
/// <summary>
|
||||
/// Sets the size of the work area. The work area is the portion of the screen not obscured by the system taskbar
|
||||
/// or by application desktop toolbars. The pvParam parameter is a pointer to a RECT structure that specifies the
|
||||
/// new work area rectangle, expressed in virtual screen coordinates. In a system with multiple display monitors,
|
||||
/// the function sets the work area of the monitor that contains the specified rectangle.
|
||||
/// </summary>
|
||||
SETWORKAREA = 0x2F,
|
||||
}
|
||||
}
|
36
SafeExamBrowser.WindowsApi/Constants/SPIF.cs
Normal file
36
SafeExamBrowser.WindowsApi/Constants/SPIF.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See http://www.pinvoke.net/default.aspx/Enums/SPIF.html.
|
||||
/// </remarks>
|
||||
[Flags]
|
||||
internal enum SPIF
|
||||
{
|
||||
NONE = 0x00,
|
||||
|
||||
/// <summary>
|
||||
/// Writes the new system-wide parameter setting to the user profile.
|
||||
/// </summary>
|
||||
UPDATEINIFILE = 0x01,
|
||||
|
||||
/// <summary>
|
||||
/// Broadcasts the WM_SETTINGCHANGE message after updating the user profile.
|
||||
/// </summary>
|
||||
SENDCHANGE = 0x02,
|
||||
|
||||
/// <summary>
|
||||
/// Performs UPDATEINIFILE and SENDCHANGE.
|
||||
/// </summary>
|
||||
UPDATEANDCHANGE = 0x03
|
||||
}
|
||||
}
|
97
SafeExamBrowser.WindowsApi/Constants/ShowWindowCommand.cs
Normal file
97
SafeExamBrowser.WindowsApi/Constants/ShowWindowCommand.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See http://www.pinvoke.net/default.aspx/Enums/ShowWindowCommand.html.
|
||||
/// </remarks>
|
||||
internal enum ShowWindowCommand
|
||||
{
|
||||
/// <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,
|
||||
|
||||
/// <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
|
||||
}
|
||||
}
|
64
SafeExamBrowser.WindowsApi/Constants/StickyKeysFlags.cs
Normal file
64
SafeExamBrowser.WindowsApi/Constants/StickyKeysFlags.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-stickykeys#members
|
||||
/// </remarks>
|
||||
[Flags]
|
||||
internal enum StickyKeysFlags : int
|
||||
{
|
||||
/// <summary>
|
||||
/// If this flag is set, the StickyKeys feature is on.
|
||||
/// </summary>
|
||||
ON = 0x1,
|
||||
|
||||
/// <summary>
|
||||
/// If this flag is set, the StickyKeys feature is available.
|
||||
/// </summary>
|
||||
AVAILABLE = 0x2,
|
||||
|
||||
/// <summary>
|
||||
/// If this flag is set, the user can turn the StickyKeys feature on and off by pressing the SHIFT key five times.
|
||||
/// </summary>
|
||||
HOTKEYACTIVE = 0x4,
|
||||
|
||||
/// <summary>
|
||||
/// A confirmation dialog appears when the StickyKeys feature is activated by using the hot key.
|
||||
/// </summary>
|
||||
CONFIRMHOTKEY = 0x8,
|
||||
|
||||
/// <summary>
|
||||
/// If this flag is set, the system plays a siren sound when the user turns the StickyKeys feature on or off by using the hot key.
|
||||
/// </summary>
|
||||
HOTKEYSOUND = 0x10,
|
||||
|
||||
/// <summary>
|
||||
/// A visual indicator should be displayed when the StickyKeys feature is on.
|
||||
/// </summary>
|
||||
INDICATOR = 0x20,
|
||||
|
||||
/// <summary>
|
||||
/// If this flag is set, the system plays a sound when the user latches, locks, or releases modifier keys using the StickyKeys feature.
|
||||
/// </summary>
|
||||
AUDIBLEFEEDBACK = 0x40,
|
||||
|
||||
/// <summary>
|
||||
/// If this flag is set, pressing a modifier key twice in a row locks down the key until the user presses it a third time.
|
||||
/// </summary>
|
||||
TRISTATE = 0x80,
|
||||
|
||||
/// <summary>
|
||||
/// If this flag is set, releasing a modifier key that has been pressed in combination with any other key turns off the StickyKeys feature.
|
||||
/// </summary>
|
||||
TWOKEYSOFF = 0x100,
|
||||
}
|
||||
}
|
21
SafeExamBrowser.WindowsApi/Constants/SystemCommand.cs
Normal file
21
SafeExamBrowser.WindowsApi/Constants/SystemCommand.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx.
|
||||
/// </summary>
|
||||
internal enum SystemCommand
|
||||
{
|
||||
/// <summary>
|
||||
/// Closes the window.
|
||||
/// </summary>
|
||||
CLOSE = 0xF060
|
||||
}
|
||||
}
|
29
SafeExamBrowser.WindowsApi/Constants/ThreadAccess.cs
Normal file
29
SafeExamBrowser.WindowsApi/Constants/ThreadAccess.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See https://docs.microsoft.com/en-us/windows/desktop/ProcThread/thread-security-and-access-rights.
|
||||
/// </remarks>
|
||||
[Flags]
|
||||
internal enum ThreadAccess : int
|
||||
{
|
||||
TERMINATE = 0x1,
|
||||
SUSPEND_RESUME = 0x2,
|
||||
GET_CONTEXT = 0x8,
|
||||
SET_CONTEXT = 0x10,
|
||||
SET_INFORMATION = 0x20,
|
||||
QUERY_INFORMATION = 0x40,
|
||||
SET_THREAD_TOKEN = 0x80,
|
||||
IMPERSONATE = 0x100,
|
||||
DIRECT_IMPERSONATION = 0x200
|
||||
}
|
||||
}
|
25
SafeExamBrowser.WindowsApi/Constants/VirtualKeyCode.cs
Normal file
25
SafeExamBrowser.WindowsApi/Constants/VirtualKeyCode.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (c) 2024 ETH Zürich, IT Services
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
namespace SafeExamBrowser.WindowsApi.Constants
|
||||
{
|
||||
/// <remarks>
|
||||
/// See https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes.
|
||||
/// </remarks>
|
||||
internal enum VirtualKeyCode
|
||||
{
|
||||
A = 0x41,
|
||||
Q = 0x51,
|
||||
Delete = 0x2E,
|
||||
LeftAlt = 0xA4,
|
||||
LeftControl = 0xA2,
|
||||
LeftWindows = 0x5B,
|
||||
RightAlt = 0xA5,
|
||||
RightControl = 0xA3
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user