Interface INativeManager
- Namespace
- Whim
- Assembly
- Whim.dll
Manager for interacting with native Windows APIs.
public interface INativeManager
Properties
Compositor
The compositor for Whim.
Compositor Compositor { get; }
Property Value
Methods
CreateTransparentWindowController(Window)
Creates a TransparentWindowController for the given
window
.TransparentWindowController CreateTransparentWindowController(Window window)
Parameters
window
Window
Returns
DeferWindowPos()
Creates a handle which will facilitates setting the position of multiple windows at once.
DeferWindowPosHandle DeferWindowPos()
Returns
DeferWindowPos(IEnumerable<DeferWindowPosState>)
Creates a handle which will facilitates setting the position of multiple windows at once.
DeferWindowPosHandle DeferWindowPos(IEnumerable<DeferWindowPosState> windowStates)
Parameters
windowStates
IEnumerable<DeferWindowPosState>- The initial window states to set.
Returns
DwmGetWindowRectangle(HWND)
Returns the window's rectangle from DWM.
IRectangle<int>? DwmGetWindowRectangle(HWND hwnd)
Parameters
hwnd
HWND
Returns
ForceForegroundWindow(HWND)
Force the window to the foreground.
void ForceForegroundWindow(HWND hwnd)
Parameters
hwnd
HWND
GetClassName(HWND)
Safe wrapper around GetClassName(HWND, PWSTR, int).
string GetClassName(HWND hwnd)
Parameters
hwnd
HWND
Returns
GetUwpAppProcessPath(IWindow)
Retrieves the path to the executable file of the UWP app associated with the given
window
.
This will only work for UWP apps (see IsUwp).string? GetUwpAppProcessPath(IWindow window)
Parameters
window
IWindow
Returns
GetWhimVersion()
Gets the version of Whim.
string GetWhimVersion()
Returns
GetWindowOffset(HWND)
Returns the window's offset.
This is based on the issue raised at https://github.com/workspacer/workspacer/issues/139, and the associated fix from https://github.com/workspacer/workspacer/pull/146.
This is based on the issue raised at https://github.com/workspacer/workspacer/issues/139, and the associated fix from https://github.com/workspacer/workspacer/pull/146.
IRectangle<int>? GetWindowOffset(HWND hwnd)
Parameters
hwnd
HWND
Returns
HideCaptionButtons(HWND)
Hides the caption buttons from the given window.
void HideCaptionButtons(HWND hwnd)
Parameters
hwnd
HWND
HideWindow(HWND)
Hides the window of the associated handle.
bool HideWindow(HWND hwnd)
Parameters
hwnd
HWND
Returns
MinimizeWindow(HWND)
Minimizes the specified window and activates the next top-level window in the Z order.
bool MinimizeWindow(HWND hwnd)
Parameters
hwnd
HWND
Returns
PreventWindowActivation(HWND)
Prevent the window from being activated.
void PreventWindowActivation(HWND hwnd)
Parameters
hwnd
HWND
QuitWindow(HWND)
Quit the window.
void QuitWindow(HWND hwnd)
Parameters
hwnd
HWND
RemoveWindowExTransparent(HWND)
Removes the transparency from the given
hwnd
.void RemoveWindowExTransparent(HWND hwnd)
Parameters
hwnd
HWND
RestoreWindow(HWND)
Activates and displays the window. If the window is minimized, maximized, or arranged,
the system restores it to its original size and position
bool RestoreWindow(HWND hwnd)
Parameters
hwnd
HWND
Returns
SetWindowCorners(HWND, DWM_WINDOW_CORNER_PREFERENCE)
Sets the preferred window corners for the given
hwnd
.
By default, the window corners are rounded.void SetWindowCorners(HWND hwnd, DWM_WINDOW_CORNER_PREFERENCE preference = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND)
Parameters
hwnd
HWNDpreference
DWM_WINDOW_CORNER_PREFERENCE
SetWindowExTransparent(HWND)
Sets the given
hwnd
to be transparent to mouse clicks.void SetWindowExTransparent(HWND hwnd)
Parameters
hwnd
HWND
ShouldSystemUseDarkMode()
Gets whether the system is using dark mode.
bool ShouldSystemUseDarkMode()
Returns
ShowWindowMaximized(HWND)
Activates the window and displays it as a maximized window.
bool ShowWindowMaximized(HWND hwnd)
Parameters
hwnd
HWND
Returns
ShowWindowMinimized(HWND)
Activates the window and displays it as a minimized window.
bool ShowWindowMinimized(HWND hwnd)
Parameters
hwnd
HWND
Returns
ShowWindowNoActivate(HWND)
Displays a window in its most recent size and position. The window is not activated.
bool ShowWindowNoActivate(HWND hwnd)
Parameters
hwnd
HWND
Returns
TryEnqueue(DispatcherQueueHandler)
Adds a task to the DispatcherQueue which will be executed on the thread associated
with the DispatcherQueue.
bool TryEnqueue(DispatcherQueueHandler callback)
Parameters
callback
DispatcherQueueHandler- The task to execute.