fork of http://www.ninjacrab.com/persistent-windows/ with windows 10 update
Find a file
2024-02-05 23:10:56 -08:00
.github Create FUNDING.yml 2024-02-05 23:10:56 -08:00
Ninjacrab.PersistentWindows.Solution undo print capture event for taskbar window 2024-02-05 21:45:48 -08:00
.gitignore Updated .gitignore for generated files 2020-04-09 09:48:26 -07:00
Help.md simplify help by remove description of internal command switches 2024-02-05 18:22:25 -08:00
LICENSE licensed as GPL 3.0 (per issue #129) 2021-09-20 10:51:54 -07:00
README.md Update README.md 2024-01-13 14:58:55 -08:00
showicon.png update snapshot instructions in online help 2020-11-26 11:20:40 -08:00

PersistentWindows

The code is forked from ninjacrab.com/persistent-windows to fix a long-standing issue on Windows 7/10/11 where windows get repositioned upon computer system waking up, laptop switching external display, monitor resolution changing (such as exit from full screen gaming) or RDP reconnecting.

Original Description

What is PersistentWindows?

A poorly named utility that persists window positions and size when the monitor display count/resolution adjusts and restores back to its previous settings.

For those of you with multi-monitors running on a mixture of DisplayPort and any other connection, you can run this tool and not have to worry about re-arranging when all is back to normal.

Key Features

  • Keeps track of window position change, and automatically restores the desktop layout, including the taskbar position, to the last matching monitor setup.
  • Supports remote desktop sessions with multiple display configurations.
  • Capture windows to disk: saves desktop layout captures to the hard drive in liteDB format, so that closed windows can be restored after a reboot.
  • Capture snapshot: saves desktop layout snapshots in memory (max 36 for each display configuration). The window z-order is preserved in the snapshot. This feature can be used as an alternative to virtual desktops on Windows 10.
  • Auto Restore can be paused/resumed as desired.
  • Supports automatic upgrades.
  • Support foreground/background dual position switching. For more Features and Commands, take a look at the Quick Help page

Installation

  • Download the latest PersistentWindows*.zip file from the Releases page

  • Unzip the file into any directory.

    • Note, the program can be run from any directory, but the program saves its data in C:\Users\[User]\AppData\Local\PersistentWindows
  • Double click auto_start_pw.bat to create a task in Task Scheduler to automatically start PersistentWindows when the current user login.

  • It is highly recommended to run auto_start_pw.bat as administrator in order to restore windows with elevated privilege (such as Task Manager, Event Viewer etc).

    image

Usage Instructions

  • Run PersistentWindows.exe (preferably as administrator). This app has no main window and its icon is hidden in the System Tray area on the taskbar by default.

  • To have the icon always appear on the taskbar, flip on the PersistentWindows item in the taskbar settings. taskbar setting

  • Right click the icon to show the menu, where the capture and restore actions can be selected. image

  • To restore taskbar position, avoid moving mouse when the icon turns red.

  • When software upgrades are available, a notice will show up in the menu.

Privacy Statement

  • PersistentWindows performs its duty by collecting following information,
    • window position
    • window size
    • window zorder
    • window caption text
    • window class name
    • process id and command line of the window
    • key-strokes when interacting with PersistentWindows icon on taskbar
    • Ctrl Alt Shift key strokes when click or move a window
  • The memory of key-strokes is typically less than 2 seconds
  • Window information history is kept in memory or on hard drive in LiteDB file format, waiting to be recalled by auto/manual restore
  • PersistentWindows periodically checks the github home page for software version upgrade, which can be disabled in menu

Known Issues

  • Multiple invocations of "Restore windows from disk" might be needed in order to recover all missing windows after system startup.

  • PersistentWindows can get stuck in a "busy" state (with a red icon in the System Tray) during a restore if one of the windows becomes unresponsive. You may find out the culprit window in Task Manager using "Analyze wait chain". The unresponsive app might need an immediate hot-upgrade, or need to be killed to let PersistentWindows proceed

    image wait chain

Tips To Digest Before Reporting A Bug

  • The window z-order can be restored in addition to the two-dimentional layout. This feature is enabled for snapshot restore only.
  • To help me diagnose a bug, please run Event Viewer, locate the "Windows Logs" -> "Application" section, then search for Event ID 9990 and 9999, and copy-paste the content of these events to the new issue report, as shown in following example image
  • If there are too many events to report, click "Filter current log" from the Action panel in event viewer, choose all 9990,9999 events in last hour, then click "Save Filtered Log File As", and attach the saved events file in bug report image