Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RememberWindowsState

RememberWindowsState application icon

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.

Python Platform Latest Release Downloads License Status


Table of Contents


Overview

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.


Features

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

Installation

Use Prebuilt Installer

The easiest way to get started is to download the prebuilt installer:

  1. Download the latest installer (RememberWindowsState-Setup.exe) from the Releases page.
  2. Run the installer and follow the setup wizard.
  3. The application will launch and run silently in your System Tray.

Build from Source

Requirements

  • 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.

Setup Steps

  1. Clone the repository

    git clone https://github.com/mostafanazarzadeh/RememberWindowsState.git
    cd RememberWindowsState
  2. Install dependencies

    pip install -r requirements.txt
  3. Launch the application

    python main.py

Build Installer (.exe)

Build a standalone Windows executable and Inno Setup installer with a single command:

build.bat

This will:

  1. Run PyInstaller to package the app into a single .exe
  2. Run Inno Setup to produce a .exe installer in dist/

Make sure Inno Setup 6 is installed at its default location before running the build script.


Usage

System Tray Menu

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

Restore Dialog

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

Launch Modes

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

Configuration

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.


Data & Storage

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.


Project Structure

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)

How It Works

┌─────────────────────────────────────────────────────────────┐
│                     RememberWindowsState                    │
│                                                             │
│  ┌──────────────┐   every N sec   ┌───────────────────┐    │
│  │  Scheduler   │ ──────────────► │  Window Tracker   │    │
│  └──────────────┘                 │  (Win32 EnumWindows│    │
│                                   │   + psutil)        │    │
│                                   └────────┬──────────┘    │
│                                            │ snapshot       │
│                                            ▼               │
│                                   ┌───────────────────┐    │
│                                   │  windows_state.json│    │
│                                   └────────┬──────────┘    │
│                                            │ on launch      │
│                                            ▼               │
│                                   ┌───────────────────┐    │
│                                   │  Restore Dialog   │    │
│                                   │  (Tkinter UI)     │    │
│                                   └───────────────────┘    │
└─────────────────────────────────────────────────────────────┘
  1. Track: window_tracker.py uses the Win32 EnumWindows API (via pywin32) along with psutil to enumerate all visible, non-system windows.
  2. Snapshot: Each window's title, executable path, and screen coordinates are serialised to windows_state.json.
  3. Schedule: scheduler.py calls the snapshot function on a configurable timer in a background daemon thread.
  4. Restore: On next launch, window_restorer.py compares the snapshot against currently running processes and offers to relaunch any that are missing.

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -m "feat: add my feature"
  4. Push the branch: git push origin feature/my-feature
  5. Open a Pull Request

Please follow Conventional Commits for commit messages and keep pull requests focused on a single concern.

Reporting Bugs

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 OfficePowerManagerWindow or 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

Privacy

RememberWindowsState collects no personal data and makes no network connections. See PRIVACY.md for full details.


License

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.

About

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.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages