Display-Lock is a lightweight Windows application that locks your mouse cursor to a selected window. Designed with performance in mind, it's the perfect tool for gamers using multi-monitor setups or anyone who needs to prevent accidental cursor movement outside a specific window.
Quick Links: Features | Installation | Building | Configuration | Contributing
- Cursor Locking - Lock your cursor to a selected window with a single click
- Window Selection - Easy UI to choose from open windows on your system
- Borderless Window Mode - Convert any window to borderless for a cleaner look
- Fullscreen Expansion - Expand windows to fill your entire monitor
- Application Whitelist - Auto-lock cursor for specified applications
- System Tray Integration - Minimize to system tray with quick context menu access
- Update Checker - Automatic checking for new versions
- Lightweight & Portable - Pure Win32 API implementation with no external dependencies
- Multi-Monitor Support - Seamlessly works across multiple monitor setups
Download the latest release from the Releases page.
- Windows 10 or later
- No installation required - simply extract and run the executable
Display-Lock is fully portable and can be run from any location. No administrative privileges are required.
- Download and run the executable
- Select a window from the "Window Select" tab
- Click "Lock Cursor" to confine your cursor to that window
- Click "Unlock" or switch focus to another window to release the lock
- Window Select: Choose which window to lock the cursor to
- Settings: Configure application behavior
- Applications: Add applications to the whitelist for automatic cursor locking
Configuration files are stored in %APPDATA%/DisplayLock/. Settings are saved in a binary .DLOCK format.
| Setting | Description |
|---|---|
| Minimize on Start | Automatically minimize the application on startup |
| Bring to Foreground | Automatically bring the locked window to the foreground |
| Borderless Window | Convert the selected window to borderless mode |
| Fullscreen | Expand the window to fill the entire monitor |
| Check for Updates | Periodically check for new versions |
| Minimize to Tray | Hide the application in the system tray instead of taskbar |
- Gaming: Keep your cursor confined to a windowed game, preventing accidental clicks outside the window
- Multi-Monitor Gaming: Play fullscreen games on one monitor without cursor drift to others
- Window Management: Convert borderless fullscreen windows for streaming or video capture
- Application Monitoring: Automatically lock cursor when specific applications are in focus
- CMake 3.24 or later
- Visual Studio 2022 with MSVC
- Windows 10 SDK
# Configure and build (Release)
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
# Configure and build (Debug)
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug
# Run tests
ctest --test-dir build -C Release
# Run a specific test
ctest --test-dir build -C Release -R SettingsTestThe compiled executable will be in the build directory.
src/- Main application with Win32 UIsrc/components/- Core functionality librarywin.c- Cursor locking logicsettings.c- Configuration persistenceapplications.c- Application whitelist managementnotify.c- System tray integrationupdate.c- Version checkingmenu.c- Menu UI handling
tests/- Google Test test suitedocs/- Documentation and assets
For more details, see the CLAUDE.md architecture documentation.
Contributions are always welcome! Please read our Contributing Guidelines before submitting a pull request.
- Discuss proposed changes via GitHub issues before starting work
- Work on the
developbranch (or a branch checked out from develop) - For hotfixes, work off the
masterbranch - Update CHANGELOG.md with your changes
- Add tests if applicable
- Ensure all builds pass and tests succeed before submitting
- External dependencies (this project prioritizes being lightweight)
- Manual version number changes or build script modifications
- Machine-specific project configurations
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Report Issues: GitHub Issues
- View Changelog: CHANGELOG.md
- Latest Releases: GitHub Releases
- Download Latest: Download


