Proof-of-concept demonstrating that Windows' default shell (explorer.exe) can be completely replaced by a custom shell written in Java, with persistent OpenGL rendering injected behind desktop icons.
This project is Work In Progress, so it is to be only intended as a proof-of-concept.
Hextop hijacks the Windows desktop environment by:
-
Replacing the shell — manipulates the registry to register itself as the system shell instead of
explorer.exe, with a failsafe mechanism that restores the original shell on abnormal exit. -
Injecting a rendering surface — reverse-engineers the Windows desktop window hierarchy (specifically the
WorkerWwindow) to insert a persistent OpenGL or Vulkan rendering context behind the desktop icons, allowing arbitrary graphics to be rendered on the desktop wallpaper layer. -
Maintaining process hygiene — runs
explorer.exeas a child process so the shell UI (taskbar, start menu, file explorer) still functions, while the custom shell controls the desktop canvas itself. -
Handling WorkerW lifecycle — implements a custom event loop (
ExplorerWatchdog) to survive Windows 11's aggressive WorkerW window recycling, which would otherwise kill the rendering surface.
Win32.java— FFM API bindings forShell32.dllandUser32.dllvia Java's Project Panama Foreign Function & Memory API. Low-overhead native calls without JNI.WinExplorerSession.java— manages the explorer.exe child process and registry manipulation for shell persistence.WallpaperManagerWin11.java— locates and injects into the WorkerW window hierarchy. Windows 11-specific because the window structure differs from Windows 10.ExplorerWatchdog.java— monitors window hierarchy changes and re-injects the rendering surface when Windows destroys and recreates WorkerW.WinUtil.java— helper functions for window enumeration, message pumping, and event handling at the OS level.
The rendering layer is abstracted to support both OpenGL and Vulkan backends:
RenderingContext— backend-agnostic interface for rendering.GLRenderingContext/VkRenderingContext— OpenGL 3.3+ and Vulkan implementations.Scene— scene graph with mesh registration, instancing support, and transform hierarchy.GLMesh/GLInstancedMesh— GPU buffer management for static and instanced geometry.
GLFW is used for window creation, but the actual rendering target is the hijacked WorkerW HWND, not a GLFW-managed window.
Runtime platform detection to ensure the shell replacement only activates on Windows. Other platforms fall back to a standard GLFW window without shell manipulation.
-
Registry failsafe: On startup, the original shell path is stashed. On shutdown (normal or crash), a shutdown hook restores
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shelltoexplorer.exe. This prevents bricking the system if Hextop crashes. -
FFM instead of JNI: Uses Java's Foreign Function & Memory API (Project Panama) for direct native calls. Much lower overhead than JNI and no need for separate native libraries.
-
WorkerW injection: Windows creates a "WorkerW" window under the "Progman" (Program Manager) window to host the wallpaper. Hextop finds this window via
EnumWindows, gets its HDC, and creates an OpenGL context on it. -
Windows 11 lifecycle quirks: Windows 11 aggressively destroys and recreates WorkerW windows during certain operations (desktop refresh, display settings changes). The watchdog thread detects this and re-injects the rendering surface.
src/main/java/com/fractalino/hextop/
├── Hextop.java # Entry point
├── HextopSession.java # Session management (platform-agnostic)
├── HextopWindowsSession.java # Windows-specific shell hijacking
├── win/
│ ├── Win32.java # FFM bindings (Shell32, User32)
│ ├── WallpaperManagerWin11.java # WorkerW injection
│ ├── ExplorerWatchdog.java # WorkerW lifecycle monitoring
│ ├── WinExplorerSession.java # Explorer.exe child process + registry
│ └── WinUtil.java # Window enumeration helpers
├── gfx/
│ ├── Scene.java # Scene graph
│ ├── Mesh.java / MeshRegister.java
│ └── RenderingContext.java # Backend abstraction
├── gl/
│ ├── GLRenderingContext.java # OpenGL backend
│ ├── GLMesh.java / GLInstancedMesh.java
│ └── GLShaderProgram.java
├── vk/
│ └── VkRenderingContext.java # Vulkan backend (stub)
└── glfw/
├── DesktopWindow.java
└── GLFWUtil.java # GLFW initialization