Windows remember window size

Windows 10 does not remember window position and size

If Windows does not remember the window position and size then this post will help you fix the problem. Although Windows 10 should open the closed windows in their last used size and position, sometimes a malfunction can cause it to behave otherwise. To fix that problem, we have listed some workarounds as well as third-party solutions so that you can get the job done.

Windows does not remember window position and size

To fix the issue of your Windows 10 not remembering the window position and size, follow these suggestions to reset window size and position:

  1. Use Shift key while closing a window
  2. Restore previous folder windows at logon
  3. Use Cascade windows
  4. Use AquaSnap
  5. Use WinSize2

Let’s delve into these suggestions.

1] Use Shift key while closing a window

If Windows 10 doesn’t remember the last used window position and size, you can use this little trick.

In general, users click on the close button to close a window.

However, you need to click on that same button when holding the Shift key on your keyboard. This trick helps Windows OS to remember the window position.

2] Restore previous folder windows at logon

If you close a window and restart your computer, it doesn’t open that window after login. Windows 10 does offer that functionality, and you should enable it so that you can get the same windows back at the same position and size even after log out.

For that, you need to open Folder Options. After that, switch to the View tab, make a tick in the Restore previous folder windows at logon checkbox, and click the OK button.

3] Use Cascade windows

Windows 10 allows users to set the same size for all opened windows.

To do so, you need to use the Cascade windows option. For getting started, right-click on the Taskbar, and select Cascade windows option.

Now you can close all windows and try to open them to check if the problem is solved or not.

4] Use AquaSnap

AquaSnap, is a handy tool that allows users to set custom window size and position so that users can utilize that profile when required. If your system does not respond positively even after applying any of the solutions mentioned above, you could install AquaSnap on your computer. It allows users to extend the Aero Snap, Aero Shake, etc.

Windows 10 will not remember window location, size, or ICON sizes within windows!!

Replies (9) 

Are you referring to viewing files in File Explorer? Are these file folders or Libraries or Search Results? Do you know what template the folders are using (Folder Properties-> Customize tab)?

Windows should remember individual view settings for any folder you’ve opened in Explorer. But if you hit the limit, it can start ‘forgetting’ some views to make room for new ones. To check how many you have saved, copy & paste the following code and paste it into a PowerShell window (WinKey+X -> Windows PowerShell):

((gp «HKCU:\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU»).Nodeslots).count

Post back with the number returned after running the command.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

My name is Andre Da Costa; an Independent Consultant, Windows Insider MVP and Windows & Devices for IT MVP. I’m here to help you with your problem.

Читайте также:  Boot ini установка windows

Disable Fast Startup, then try again.

Press Windows key + X
Click Power options
Click Additional power settings under Related settings
Click Choose what the power button does
Click Change settings that are currently unavailable
Uncheck ‘Turn on fast startup (recommended)

Click Save changes.

Click Restart now and see if it works.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Try these first to see if they work:

Open Start, type: CMD
Right click CMD
Click Run as administrator

Type in at the prompt OR Copy and Paste these one at a time : (Hit enter after each)

Dism /Online /Cleanup-Image /CheckHealth

Dism /Online /Cleanup-Image /ScanHealth

Dism /Online /Cleanup-Image /RestoreHealth

Also run the System File Checker utility:
Open Start, type: CMD
Right click CMD
Click Run as administrator

At the Command Prompt, type: sfc/scannow

This will check for any integrity violations

Restart your system

Check your hard disk for any errors:
Click Start
Type: CMD, from the results, right click Command prompt
Click ‘Run as Administrator’
At the Command Prompt, type: chkdsk /r /f
Hit Enter
When you restart your system, your computer will be scanned for errors and attempts will be made to correct them.

Was this reply helpful?

Sorry this didn’t help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

5000 is the limit. So every time you view a new folder, Explorer is deleting another one to make room.

You can increase the number of views saved by creating/editing a registry value found under:

HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell

The value is named ‘BagMRU Size’, if it doesn’t exist, create it as a DWORD type and set its value to 10,000.

The other option, and the one I would recommend, is to ‘clean house’ — delete all saved views and the BagMRU index, customize the default template for each folder type using ‘Apply to folders’, and then making further modifications for individual folders as you view them.

Happy to guide you through the deletion via regedit.exe or PowerShell commands if you want to do this.

Depending on your needs and level of comfort with Regedit and PowerShell, there are a few other tricks to modify templates that can’t be modified by ‘Apply to folders’ (Libraries and Search Results).

The title of your post also mentions window size and location. While these were saved on a per-folder basis in XP, the code has been removed — Explorer now only saves one application-wide position and size.

.NET WPF Remember window size between sessions

Basically when user resizes my application’s window I want application to be same size when application is re-opened again.

At first I though of handling SizeChanged event and save Height and Width, but I think there must be easier solution.

Pretty simple problem, but I can not find easy solution to it.

12 Answers 12

Save the values in the user.config file.

You’ll need to create the value in the settings file — it should be in the Properties folder. Create five values:

  • Top of type double
  • Left of type double
  • Height of type double
  • Width of type double
  • Maximized of type bool — to hold whether the window is maximized or not. If you want to store more information then a different type or structure will be needed.
Читайте также:  Аналог rdp для linux

Initialise the first two to 0 and the second two to the default size of your application, and the last one to false.

Create a Window_OnSourceInitialized event handler and add the following:

NOTE: The set window placement needs to go in the on source initialised event of the window not the constructor, otherwise if you have the window maximised on a second monitor, it will always restart maximised on the primary monitor and you won’t be able to access it.

Create a Window_Closing event handler and add the following:

This will fail if the user makes the display area smaller — either by disconnecting a screen or changing the screen resolution — while the application is closed so you should add a check that the desired location and size is still valid before applying the values.

Actually you don’t need to use code-behind to do that (except for saving the settings). You can use a custom markup extension to bind the window size and position to the settings like this :

While you can «roll your own» and manually save the settings somewhere, and in general it will work, it is very easy to not handle all of the cases correctly. It is much better to let the OS do the work for you, by calling GetWindowPlacement() at exit and SetWindowPlacement() at startup. It handles all of the crazy edge cases that can occur (multiple monitors, save the normal size of the window if it is closed while maximized, etc.) so that you don’t have to.

This MSDN Sample shows how to use these with a WPF app. The sample isn’t perfect (the window will start in the upper left corner as small as possible on first run, and there is some odd behavior with the Settings designer saving a value of type WINDOWPLACEMENT ), but it should at least get you started.

The «long form» binding that Thomas posted above requires almost no coding, just make sure you have the namespace binding:

Then to save on the code-behind:

Alternatively, you might like the following approach too (see source). Add the WindowSettings class to your project and insert WindowSettings.Save=»True» in your main window’s header:

Where WindowSettings is defined as follows:

The default way of solving it is to use settings files. The problem with settings files is that you have to define all the settings and write the code that copies data back and forth yourself. Quite tedious if you have a lot of properties to keep track of.

I made a pretty flexible and very easy to use library for this, you just tell it which properties of which object to track and it does the rest. You can configure the crap out of it too if you like.

The library is called Jot (github), here is an old CodeProject article I wrote about it.

Here’s how you’d use it to keep track of a window’s size and location:

Jot vs. settings files: With Jot there’s considerably less code, and it’s a lot less error prone since you only need to mention each property once. With settings files you need to mention each property 5 times: once when you explicitly create the property and an additional four times in the code that copies the values back and forth.

Storage, serialization etc are completely configurable. Also, when using IOC, you can even hook it up so that it applies tracking automatically to all objects it resolves so that all you need to do to make a property persistent is slap a [Trackable] attribute on it.

I’m writing all this because I think the library is top notch and I want to mouth off about it.

WindowManager: remember window sizes and positions in Windows

WindowManager is a long-standing shareware program for the Windows operating system that remembers window sizes and positions so that they are launched using the same screen position and dimensions each time.

Читайте также:  Solar shade windows film

The program supports a variety of other features, from configuring custom dimensions and size to lots of triggers, hotkeys, and more.

Programs that don’t remember window size and position on the screen on exit or don’t load them properly on next start are frustrating. I ran into an issue with Firefox Nightly recently. I run the browser on half the screen on a 1920×1080 monitor but Firefox would also load with some space between the browser interface and the taskbar, and I could not figure out why this was happening.

WindowManager

WindowManager supports all 32-bit and 64-bit versions of Windows starting with Windows XP (including server versions).

The program is shareware but you can download a 30-day free trial from the developer website. A free alternative is listed below if you are interested in that.

The Windows software can remember the size and position of programs running on Windows so that program windows open always in the exact location on the screen.

It is not a run-and-forget type of program though. The main interface displays the available rules on start. You can select «all windows» there to add all running program windows to the rules section to get started.

A click on edit after selecting one of the programs opens the rules editor. You define matching rules — the program matches based on window title, program file name, and window class — the actions and advanced options.

Actions define window position, size, state, and other related variables. Use the get, set and pick options, or enter values manually to get started. Get pulls the current position, state, and size and enters the values automatically. Set enforces the rules so that you can verify them.

WindowManager may lock size, position and state of any window, enforce that the window is always visible on the screen (and not moved outside of it). Other options include setting the window to be always on top or at the bottom.

Advanced options let you set commands that you want execute on window open and close. The commands include clicking, moving, or typing text into the window when it opens or closes.

Once you have configured rules you can save them to the profile. The rules are enforced automatically when WindowManager runs and matching program windows get opened or closed on the system.

WindowManager supports a sophisticated triggering system to enforce rules automatically or manually. Set a hotkey for all windows of a profile or the active one to quickly enforce rules to display it in a certain position and with a certain size and state on the screen.

The program supports screen triggers to apply rules when the screen resolution changes, session triggers which activate during logon, logoff, or connect operations, power and time triggers.

The screen trigger could prove useful to users who use multiple monitors on their device or connect their computer to different monitors regularly.

Closing Words

WindowManager worked with any program window I set custom rules for. It resolved the issue with Firefox on my system but worked with Windows Explorer, Thunderbird, and any other program window that I tried it with as well. It even worked with dialog windows.

The program supports profiles that you can switch between and other nice to have features such as silent deployment options, or multi-monitor support.

The asking price of $10 is reasonable considering that the license does not expire. You may buy the «lifetime free upgrades» to include all future upgrades; if you don’t, only minor version upgrades and one year of major version upgrades are included.

Alternatives?

You can check out WindowPadX which supports moving and resizing windows among many other things. If it is just the window state you are after, check out Auto Window Manager instead.

Оцените статью