Windows 10/11 tray app for Linux-style window manipulation:
- Modifier + left-drag: move window
- Modifier + middle-drag: resize from closest corner, anchored at opposite corner
- Mouse cursor switches to a hand while move/resize is active
The app ignores desktop/taskbar/tool windows.
Right-click the tray icon:
- Modifier Key
altwindows keycntrl- persists across restarts
- Run at Windows Startup (toggle)
- Open Log Window
- Open Log Folder
- About (shows version)
- Exit
Several simpler approaches were attempted first and failed on real systems:
-
WM_SYSCOMMAND/SC_MOVEandWM_NCLBUTTONDOWNsimulation- Expected: native window move loop.
- Problem: unreliable initiation across apps/windows; sometimes no move at all.
-
Direct
SetWindowPosfrom hook events (anchor-from-start)- Expected: deterministic movement.
- Problem: jitter/snap-back due to event ordering and OS interaction.
-
Low-level mouse hook with Alt flag only
- Problem: modifier detection inconsistency (
LLMHF_ALTDOWNnot always reliable).
- Problem: modifier detection inconsistency (
-
Physical cursor APIs + DPI scaling variants
- Problem: on some machines this caused under-movement, zero movement, or oscillation.
-
Aggressive Win-key event swallowing for Start-menu suppression
- Problem: could leave Windows key in a "stuck" state for keyboard input.
- Mouse hook starts/stops action only.
- A polling loop (
GetCursorPos) drives movement/resizing at steady intervals. - Win-key Start-menu suppression is handled without leaving Win-key state stuck.
- Modifier is user-selectable from tray menu and saved in user settings.
dotnet build -c Releasedotnet publish -c Release -r win-x64 --self-contained falsePublished EXE:
bin\Release\net9.0-windows\win-x64\publish\LinuxWindowDrag.exe