Never lose your workspace again. RememberWindowsState automatically saves your open windows and restores them after a restart, shutdown, or crash — silently running in the System Tray.
- Overview
- Features
- Installation
- Usage
- Configuration
- Data & Storage
- Project Structure
- How It Works
- Contributing
- Privacy
- License
RememberWindowsState is a lightweight Windows utility that periodically snapshots your open application windows (title, executable path, and position) and restores them on demand. It is designed to be completely unobtrusive — living in the System Tray with zero visible footprint while you work.
Whether you've experienced an unexpected shutdown, a Windows Update reboot, or simply want to pick up exactly where you left off, RememberWindowsState has you covered.
| Feature | Description |
|---|---|
| ⏱ Auto-Save Snapshots | Automatically captures your open windows at configurable intervals (10 seconds → 30 minutes) |
| 🔄 Smart Restore | At startup, shows only windows that are not already open — no duplicates |
| 🚀 Run at Windows Login | Optional autostart via Windows Registry |
| 🖥 System Tray Icon | Runs silently in the background with a clean tray menu |
| 🚫 Application Blacklist | Exclude specific apps (by .exe name) from being tracked |
| 📜 Snapshot History | View the last saved snapshot directly from the tray |
| 🔄 Software Update Check | Check for latest releases from GitHub directly in General Settings |
| 🔒 Single-Instance Guard | Prevents multiple instances from running simultaneously |
| 💾 Local Storage Only | All data is stored exclusively on your local machine — no cloud, no telemetry |
| 📋 Encrypted Clipboard Memory | Optionally remembers the latest text clipboard item across restarts using Windows DPAPI |
The easiest way to get started is to download the prebuilt installer:
- Download the latest installer (
RememberWindowsState-Setup.exe) from the Releases page. - Run the installer and follow the setup wizard.
- The application will launch and run silently in your System Tray.
- OS: Windows 10 or Windows 11 (64-bit)
- Python: 3.10 or higher
- Dependencies (auto-installed via
pip):
pywin32 >= 306
psutil >= 5.9.0
pystray >= 0.19.5
Pillow >= 10.0.0
For building an installer from source, Inno Setup 6 is also required.
-
Clone the repository
git clone https://github.com/mostafanazarzadeh/RememberWindowsState.git cd RememberWindowsState -
Install dependencies
pip install -r requirements.txt
-
Launch the application
python main.py
Build a standalone Windows executable and Inno Setup installer with a single command:
build.batThis will:
- Run PyInstaller to package the app into a single
.exe - Run Inno Setup to produce a
.exeinstaller indist/
Make sure Inno Setup 6 is installed at its default location before running the build script.
Right-click the tray icon to access:
| Action | Description |
|---|---|
| 💾 Save Now | Immediately take a snapshot of all open windows |
| 🔄 Restore Windows | Show a list of previously saved windows to reopen |
| ⚙️ Settings | Open the settings panel |
| ❌ Exit | Quit the application |
When RememberWindowsState launches manually (not via Windows startup), it automatically checks whether any previously saved windows are not currently open. If so, it presents a Restore Dialog where you can:
- Select individual windows to reopen
- Select all with one click
- Dismiss and continue without restoring
| Command | Behavior |
|---|---|
python main.py |
Manual launch — shows restore dialog if unclosed windows exist |
python main.py --startup |
Startup launch — skips restore dialog, tracks silently |
Open Settings from the tray icon to configure:
| Setting | Default | Description |
|---|---|---|
| Save Interval | 30 seconds | How often to snapshot open windows |
| History Limit | 50 states | Maximum saved snapshot entries to maintain in history |
| Run at Windows Startup | Off | Add/remove from Windows Registry autostart |
| Windows Explorer | On | Track and restore individual open Explorer folder paths |
| Clipboard Memory | On | Encrypt and restore the latest text clipboard item across restarts |
| Blacklist | (empty) | List of .exe filenames to exclude from tracking |
Settings are persisted automatically to config.json.
All data is stored locally on your machine under:
%APPDATA%\RememberWindowsState\
├── config.json ← Application settings
├── windows_state.json ← Latest window snapshot
├── clipboard_state.json ← Encrypted latest text clipboard item (optional)
└── logs/
└── app.log ← Application log file (rotated at 200 KB)
On Windows, this typically resolves to:
C:\Users\<YourName>\AppData\Roaming\RememberWindowsState\
The windows_state.json file stores:
- Window title
- Executable path (
exe) - Window position and size (
rect)
No personal data, keystrokes, or screen content is ever captured.
When Clipboard Memory is enabled, only the latest Unicode text clipboard item is stored. The content is encrypted with Windows DPAPI for the current Windows user and restored to the clipboard after the application starts. Clipboard contents are never written to the application log. Disabling Clipboard Memory stops monitoring and restoration.
RememberWindowsState/
│
├── main.py ← Application entry point & orchestration
├── config.py ← Settings management (JSON persistence)
├── window_tracker.py ← Win32 API window enumeration & snapshotting
├── window_restorer.py ← Subprocess-based window launching & filtering
├── scheduler.py ← Background timer for periodic snapshots
├── startup.py ← Windows Registry autostart integration
├── restore_dialog.py ← Tkinter restore selection dialog
├── settings_gui.py ← Tkinter settings panel
├── tray_app.py ← pystray System Tray integration
├── create_icon.py ← Pillow-based icon generation utility
│
├── RememberWindowsState.spec ← PyInstaller build spec
├── installer.iss ← Inno Setup installer script
├── build.bat ← One-click build script
├── requirements.txt ← Python dependencies
│
└── assets/
├── icon.png ← Application icon (source)
└── icon.ico ← Application icon (Windows)
┌─────────────────────────────────────────────────────────────┐
│ RememberWindowsState │
│ │
│ ┌──────────────┐ every N sec ┌───────────────────┐ │
│ │ Scheduler │ ──────────────► │ Window Tracker │ │
│ └──────────────┘ │ (Win32 EnumWindows│ │
│ │ + psutil) │ │
│ └────────┬──────────┘ │
│ │ snapshot │
│ ▼ │
│ ┌───────────────────┐ │
│ │ windows_state.json│ │
│ └────────┬──────────┘ │
│ │ on launch │
│ ▼ │
│ ┌───────────────────┐ │
│ │ Restore Dialog │ │
│ │ (Tkinter UI) │ │
│ └───────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Track:
window_tracker.pyuses the Win32EnumWindowsAPI (viapywin32) along withpsutilto enumerate all visible, non-system windows. - Snapshot: Each window's title, executable path, and screen coordinates are serialised to
windows_state.json. - Schedule:
scheduler.pycalls the snapshot function on a configurable timer in a background daemon thread. - Restore: On next launch,
window_restorer.pycompares the snapshot against currently running processes and offers to relaunch any that are missing.
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Commit your changes:
git commit -m "feat: add my feature" - Push the branch:
git push origin feature/my-feature - Open a Pull Request
Please follow Conventional Commits for commit messages and keep pull requests focused on a single concern.
Please open a GitHub Issue if you run into any problems, such as:
- Any applications that are supposed to be restored/opened but fail to launch.
- Any internal background helper windows (such as
OfficePowerManagerWindowor other hidden system components) mistakenly showing up in your tracked window list or restore dialogs.
When reporting bugs, please attach/include your log file. You can find it at:
%APPDATA%\RememberWindowsState\logs\app.log
(Typically: C:\Users\<YourName>\AppData\Roaming\RememberWindowsState\logs\app.log)
When reporting, please include:
- Your Windows version
- Python version
- Steps to reproduce
- The name, title, or class of any background window that shouldn't have been tracked (if applicable)
- The name/executable path of any application that failed to restore (if applicable)
- Any error messages from the console or log files
RememberWindowsState collects no personal data and makes no network connections. See PRIVACY.md for full details.
This project is licensed under the GNU General Public License v3.0 or later (GPL-3.0-or-later) — see LICENSE for details.
Made with ❤️ in Iran for Windows power users who hate losing their workspace.