Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ryzhpolsos/redeye/llms.txt

Use this file to discover all available pages before exploring further.

IShellWindow represents a top-level shell window managed by RedEye. Each window declared in the layout XML is backed by an IShellWindow implementation. The interface exposes the full lifecycle — initialization, visibility, icon and title management, and event registration — and provides access to the window’s configuration via ShellWindowConfig.

IShellWindow interface

IShellWindow lives in RedEye.Core and extends both IComponent and IWidgetContainer.

InitWindow

Initializes the window according to its current ShellWindowConfig. Creates the underlying Win32 window with the configured type, border style, size, and position. Must be called before any other visibility method.
void InitWindow();

ShowWindow

Makes the window visible synchronously on the UI thread.
void ShowWindow();

ShowWindowAsync

Makes the window visible by posting the show request to the message queue. Use this when you need to trigger visibility from a background thread or from inside an event handler without blocking.
void ShowWindowAsync();

HideWindow

Hides the window without destroying it. The window remains initialized and can be shown again with ShowWindow().
void HideWindow();

CloseWindow

Closes the window. If AllowRealClose is false in the window’s config, the window is hidden rather than destroyed.
void CloseWindow();
Use AllowRealClose = true in ShellWindowConfig only when you intend the window to be permanently destroyed on close. For toggleable panels and overlays, leave it at the default false.

ToggleWindow

Toggles visibility — shows the window if it is hidden, hides it if it is visible.
void ToggleWindow();
This is the most common method to bind to a hotkey for panels and overlay windows.

GetHwnd

Returns the native Win32 window handle (HWND) as an IntPtr. Use this when calling Win32 API functions directly, such as SetWindowPos or SendMessage.
IntPtr GetHwnd();
ReturnsIntPtr: the HWND, or IntPtr.Zero before InitWindow() is called.

GetTitle

Returns the current window title string.
string GetTitle();

GetIcon

Returns the current window icon as a System.Drawing.Icon.
Icon GetIcon();

SetIcon

Replaces the window icon.
void SetIcon(Icon icon);
icon
Icon
required
A System.Drawing.Icon instance. The icon is applied to both the window chrome and the taskbar button.

SetTitle

Updates the window title.
void SetTitle(string newTitle);
newTitle
string
required
The new title string to display in the window’s title bar (when a border style that shows one is active).

GetConfig

Returns the current ShellWindowConfig for this window.
ShellWindowConfig GetConfig();
ReturnsShellWindowConfig: the active configuration snapshot.

SetConfig

Replaces the window’s configuration. Typically followed by InitWindow() to apply the new settings.
void SetConfig(ShellWindowConfig newConfig);
newConfig
ShellWindowConfig
required
The new configuration to apply. All fields take effect on the next InitWindow() call.

RegisterEventHandler

Registers a callback for a named window event. Common event names mirror Win32 window messages, e.g. "Shown", "Hidden", "Closed".
void RegisterEventHandler(string name, Action eventHandler);
name
string
required
The event name to subscribe to.
eventHandler
Action
required
The callback invoked when the event fires.
window.RegisterEventHandler("Shown", () =>
{
    Logger.LogInfo("Window is now visible");
});

ShellWindowConfig class

ShellWindowConfig is a plain data class that describes every configurable aspect of a shell window. Pass an instance to SetConfig() before calling InitWindow().
Id
string
default:"\"\""
Unique identifier for this window. Used to reference the window from other parts of the config and from plugin code via IShellWindowManager.
Type
ShellWindowType
default:"Normal"
Controls the Win32 window style and z-order. See ShellWindowType below.
BorderType
ShellWindowBorderType
default:"Normal"
Controls the window border style. See ShellWindowBorderType below.
IsTransparent
bool
default:"false"
When true, the window background is set to the transparency key color, making it click-through in the transparent areas. Requires AllowTransparency = true.
Title
string
default:"\"\""
Window title text. Visible only with border types that include a title bar.
X
int
default:"0"
Left edge of the window in screen coordinates.
Y
int
default:"0"
Top edge of the window in screen coordinates.
Width
int
default:"0"
Width of the window in pixels.
Height
int
default:"0"
Height of the window in pixels.
AutoShow
bool
default:"true"
When true, the window is shown automatically after InitWindow() completes.
MinimizeButton
bool
default:"true"
Enables or disables the minimize button in the window chrome.
MaximizeButton
bool
default:"true"
Enables or disables the maximize button in the window chrome.
AllowClose
bool
default:"true"
When false, the close button in the title bar is disabled.
AllowRealClose
bool
default:"false"
When false, CloseWindow() hides the window instead of destroying it. Set to true only for windows that should be permanently destroyed on close.
AutoSize
bool
default:"false"
When true, the window sizes itself to fit its contents.
Color
string
default:"null"
Foreground color as an HTML color string, e.g. "#ffffff". Applied to text elements inside the window.
BackgroundColor
string
default:"null"
Background color as an HTML color string. Has no effect when IsTransparent is true.
Padding
string
default:"null"
Padding inside the window’s client area, in the format accepted by ParseHelper.ParsePadding, e.g. "4" or "4,8,4,8".
Opacity
double
default:"1.0"
Window opacity from 0.0 (fully transparent) to 1.0 (fully opaque). Requires AllowTransparency = true.
AllowTransparency
bool
default:"false"
Must be true for Opacity and IsTransparent to have any effect.
Icon
string
default:"null"
Path to an icon file (.ico) relative to the application directory. Applied via SetIcon() during initialization.

ShellWindowType enum

Controls the Win32 extended window styles and z-order behavior.
ValueDescription
NormalStandard overlapped window. Participates in normal z-order.
ShellRegistered as a Win32 shell window. Sits above the desktop and below normal windows.
TopAlways stays above normal windows but below TopMost windows.
TopMostAlways stays above all other windows, including Top windows.
BackgroundSits below the desktop wallpaper layer. Useful for desktop widget backgrounds.

ShellWindowBorderType enum

Controls the FormBorderStyle of the underlying Windows Form.
ValueDescription
NoneNo border or title bar. Suitable for frameless overlay panels.
NormalStandard resizable border with title bar.
FixedDialogFixed-size border styled like a dialog box.
FixedSingleFixed-size single-line border, no maximize button.
FixedToolWindowCompact title bar without minimize/maximize; stays off the taskbar.
SizableToolWindowResizable tool window border; stays off the taskbar.

Usage examples

Toggling a window from a plugin

public override void Main()
{
    IShellWindow panel = ShellWindowManager.GetWindow("overlay-panel");

    HotKeyManager.RegisterHotKey(new[] { "Ctrl", "Space" }, () =>
    {
        panel.ToggleWindow();
        return false; // do not pass the key combination to other handlers
    });
}

Creating and initializing a window at runtime

var cfg = new ShellWindowConfig
{
    Id         = "my-plugin-window",
    Type       = ShellWindowType.Top,
    BorderType = ShellWindowBorderType.None,
    X          = 100,
    Y          = 100,
    Width      = 400,
    Height     = 200,
    AllowTransparency = true,
    Opacity    = 0.9,
    AutoShow   = false
};

IShellWindow win = ShellWindowManager.CreateWindow(cfg);
win.InitWindow();
win.ShowWindow();

Subscribing to window events

IShellWindow win = ShellWindowManager.GetWindow("status-bar");

win.RegisterEventHandler("Shown", () =>
{
    Logger.LogInfo("Status bar shown");
});

Shell windows

How to declare and configure windows in RWML layout markup.

IShellWidget

The interface implemented by every widget that lives inside a shell window.

Build docs developers (and LLMs) love