Save positions of closed windows?

I've had a good search, googled, and spent hours (literally) looking through the preferences, but I'm unable to sort this out by myself. I've seen a lot of posts here somewhat related to my issue, but nothing the helps me fix it. I'm starting to suspect there might be bug in my DOpus.

I have a lot of shortcuts (on the desktop) to various directories, and when I open them I want the windows to open in the last positions where they were closed earlier on.

I.e. if I open "d:\project" and then close while in the same path "d:\project" I want DOpus to save the window's position.

How do I set it up to do that?

I do realize this was the default behavior for Explorer in Windows XP, and for some odd incomprehensible reason they removed this feature in Windows 7, so I had to use a program called ShellFolderFix to get it back.

But shouldn't DOpus be able to do this as well? Or am I missing something here? Someone got any tips to send me on my merry way to decluttering all my opened windows?

Running Win 7.

Layouts are a way to do this.

Set up a window in the position and folder you want, then select Settings > Lister Layouts > Save This Lister.

If you want a shortcut to that layout to be on your desktop so you can double-click it to open it, go to Preferences / Layouts and Styles / Layouts and drag the layout from the list to the desktop.

There is also an option under Windows Integration to add a menu of layouts to the desktop right-click menu, either directly or inside a sub-menu.

Layouts require Opus Pro. If you're using Light, it may be possible using shortcuts which run a command via dopusrt.exe with the path and window position in the command line. I'd have to check to make sure that works with Light; it'd definitely not be as easy to set up but I think should still be possible.

Script Add-Ins could also change the way things work, if you want it to be automatic when a new window opens for a particular folder, not just via a specific layout or shortcut. (Script Add-Ins also require Opus Pro.)

Hi there, thanks for the reply

Using the Layout feature just doesn't make the cut, to be honest. It becomes quite cumbersome for doing this, especially if you have a dynamic workspace like I do. I often move my windows a round a little, and I expect them to open at the same place I closed them earlier on. Without having to keep remembering to push a buttons save their position manually all the time.

I'm currently running a trial of the pro editon because that's what I'm planning on buying, but I haven't looked at the script feature yet tbh... would there be any any way to do this automated, with a script?

XP had this feature, and it's very odd they removed it in Win 7 (perhaps it was gone already in Vista, I dont know). I just doesn't make any sense why they'd remove it.

Would it be possible for you to look into adding this as a feature in a future version? Remembering the position and size of windows is something a lot of (most) programs do, you know :wink:

Small note...

would there be any any way to do this automated, with a script?

... in regards of saving a window's position/size (so it can be recalled later on).

You want a layout that, after an initial position and size are given, it remembers the size and position it last had when you closed it.

Just out of curiosity, if you have two or more windows with the same layout open, which one wins the "save my size and position" battle? Would it be the last one? That would make sense. Windows 10 behaves that way for me now. (I thought Windows 7 did, too, but can't remember.)

I'm sure one of our handier script writers could write a Script Add-In that reacts to OnCloseLister, looks up the layout name of the lister that's being closed, and saves the current lister's size and position right back onto it. This would keep the layout constantly updated to the last size and position of that layout you had open. This would mean you would not have to do anything to "trigger" the layout update.

Opus can remember the size and position of the last window you closed. (Or all the windows which were open when it was last shutdown.) That is the same thing that most programs do, and Opus can do that.

Opus can also remember the size and position of one or more windows and store them into a separate, named layout for later recall, or use commands to open windows with the sizes set in the command.

But I think you are asking for something that most programs don't do: You want it to remember window sizes and positions based on the folder that was being displayed? Or on the particular shortcut that was double-clicked to make the window open? (Already the criteria seema bit fuzzy; what if you change folders, resize the window, and start using the window for something completely unrelated? Should it still save over the shortcut that launched it?)

Scripts can find out which layout (if any) a window was opened for, and they can run when a window is closed, so they could probably update the layout automatically when the window is closed. I'd have to try it, though, to be sure. (If it doesn't work, we could always make a code change to allow it to work.)

I guess a script could also save the window position into a layout named after the current folder, then restore that position if a new window was opened for the same folder. Entirely doable. (But then what happens if you close a window with multiple folder tabs pointing to lots of folders? Just use the active one?)

> You want it to remember window sizes and positions based on the folder that was being displayed?

Yes, correct. To be honest, I am quite surprised DOpus doesn't do this.

> Just out of curiosity, if you have two or more windows with the same layout open, which one wins the "save my size and position" battle? Would it be the last one?

Yeah, the last one you closed.

I'll give you a couple of specific examples from Windows XP (to the best of my recollection) in case its been a long time sine you used it:

  1. There is a shortcut on the desktop pointing to "D:\projects\chainsaw".
  2. I double click this shortcut, and the window opens. I move the window and resize it. (I remain in the same path though, I never move away.)
  3. I close the window, and now the new position and size is saved. My guess is that XP saves only when you close a window.
  4. I double click the shortcut again, and the window opens where I left it the last time.

Also, if I hit Win+R and type in "D:\projects\chainsaw" directly to open a new window... this window opens in the same position as above, because the system has stored its position.

If I have another shortcut some place else on my system, pointing to the the same path as above and I open it, the window opens in the same position as earlier, even though its a different shortcut file.

Windows XP's Folder Options had a button "Apply to all folders". This would delete the position and size of all Explorer windows, and overwrite it with the one you currently have opened. This button does nothing in Win 7, because Win 7 does not store the position/size of individual Explorer windows anymore.

Another example to further elaborate:

If I use Win+R to go directly do a subdirectory of the path above i.e. "D:\projects\chainsaw\oil", it will open a window in the default position, because it has no saved position for it. Probably because I never closed a window while being in that specific directory. But, if I move to the parent folder "D:\projects\chainsaw" it will now update the positions/size, meaning if I use the shortcut mentioned above in the future, it will now open this window in the new updated position.

There is a small and very simple program called ShellFolderFix (screenshot) that bringes back the XP functionality in Win 7. It truly is a life saver if you are like me and often have many Explorer windows open at the same time while working on projects.

This is the functionality I want to see in DOpus. Pretty please. We need this :slight_smile:

I just want to make it clear that the position/size has nothing to do with the shortcut files themselves. It's based on the paths. Nothing else.

I.e. if I use Win+R to open "C:\Windows", resize and move the window, the close it. And then later on use Win+R and open the same path, it will open this windows in the same position as earlier.

A script add-in should be able to do that (Opus Pro only) but it isn't something that is built-in out-of-the-box.

I'd just like to add my 2 cents here: As Irios said, XP did it built in. Now, as that feature was removed from later versions of the OS, a free utility emerged called shellfolderfix which does just that. The problem is it will -naturally- not work with DOpus windows. Now, is there a chance that you could make DOpus work with it? Or, maybe, take inspiration from it and add something similar to DOpus? Afaik it keeps a database with sizes and locations for the opened folders. Or maybe I should contact the utility author and ask him if he could make it work with DOpus instead?

Or, maybe, do it the amiga way. Maybe a snapshot command/shortcut could be added and if the user needs a windows to be right there where it was the last time it was closed, he presses that, a small prefs file is created in that folder and when DOpus enters it, it reads that first and displays it accordingly.

You could do that using a script add-in.

I suspect Microsoft dropped the feature because it's fairly rare to open windows via shortcuts to folders, rather than open a window and then navigate to a folder, and most people want the same window size regardless of folder, not to have to manage each folder's window size separately.

I will look into the script option, thx!

You might be interested in the Layout_UpdateOnClose_Handler script I just posted to the Script Buttons and Add-Ins forum...