We help IT Professionals succeed at work.
Private
Troubleshooting Question

Have the windows restored to their location when pc resume

130 Views
Last Modified: 2020-08-23
Hi Experts!

Let's see how I can explain this.  I have a computer notebook with a monitor as extended.  Every morning when I log in I organize certain windows (apps) in the notebook screen and the everyday working apps in the extended monitor (I have the extended monitor as "main display" in windows settings.

I have setup screen saver to run in 10 min and sleep/turn off disk/turn off monitor etc. in 20 minutes.

When the computer hits screensaver and I press any keys, all windows are in their respective places.  However, when the notebook hits sleep mode and I come in and press any key, all the windows are moved to the "main display" (I have to relocate the windows back to their places).

So, what I am trying to accomplish is when I wake the computer, all the windows are in their respective places just I like I left them.

If it's not possible, is there any apps or tools that I can "program" where an apps is to placed? (some time back I saw a tool that u can set a layout and have the apps display where u want them - but forgot it's name or links)

Hop u guys can help!

Thanx!

Comment
Watch Question

Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
You could use DisplayFusion’s Monitor Profiles:


I know some have purchased Monitor Detect Killer devices too to prevent rearrangement.

Also, Joe Winograd — fellow Expert once again wrote an awesome EE article I just found out about too on moving all windows with a single keystroke:

https://www.experts-exchange.com/articles/33613/How-to-move-all-windows-on-one-monitor-to-another-monitor-with-a-single-keystroke.html

Author

Commented:
There is a lot of read in those links, so do they do what I need? have the apps windows restored to their location when woken?
BasheerptIT Technical Support

Commented:
Hi
Have not noticed the issue before. However, here is a solution who faced this situation:

Remove stale monitors from device manager. To do this:

- Right click on your 'ThisPC' icon on your desktop, select PROPERTIES
- Click on DEVICE MANAGER
- Click on VIEW
- Select SHOW HIDDEN DEVICES
- Expand MONITORS
- You will see all PNP and nonPNP monitors, some of them are grayed out
- Right-click on the greyed out monitors and UNINSTALL each of them. Keep the highlighted (which is your actual monitor) only
- Reboot the system, re-arrange your desktop as per your need
- check if the issue is resolved once the system get back from sleep mode next time.

Please update

Regards

Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
Yes, you could simply leverage keystrokes to restore their locations. With DisplayFusion you can create monitor profiles with a dedicated keyboard combo shortcut that will move everything back to the screen you want, however, one user I know stated it does not help with saving accessed Excel layers. Joe’s EE article presents a similar workaround with one keystroke as well.

Otherwise, if you’re really looking to avoid key combos altogether you could try Monitor Detect Killer devices — I have heard success with them. I know some users have tried to disable the Windows auto-detect key that can cause this via the registry as well. Example past Microsoft case:  

https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware/disabling-monitor-auto-detection-in-windows-10/e4f6bbc3-b45f-4880-8b06-3e339d62ac59

Author

Commented:
Jazz Kaur,

Checked your Display Fusion Monitor Profiles, but all results points to the their site www.displayfusion.com and it just stays there.

As for Monitor Detect Killer, I don’t want to buy a device for this.

Went to your link Disabling monitor auto detection in windows 10, and my computer doesn’t have HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\TMM to adjust it

Basheerpt,

There was one ‘Generic PnP Monitor’ greyed out.

I delete >> restarted >> same results.

Guys, what I am looking for is that when ever my computer wakes up from sleep, all the windows DON'T shift to my primary monitor, leaving secondary monitor empty (I am looking to do this)

Author

Commented:
Oh, also checked out Joe Winograd link (Joe is great has helped a lot before), but it doesn't say that it will stop shifting the apps to primary monitor when woke.

(so still looking)

Author

Commented:
Update:

Tried both links below, no success.
“TMM“/"UseIViewHelper" - https://endurtech.com/second-monitor-on-windows-10-resets-after-sleep/ 
and Custom DPI Scaling -  https://www.tenforums.com/tutorials/5990-change-dpi-scaling-level-displays-windows-10-a.html#option2 

Still looking
Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
I fixed the link in my initial post for some reason it didn’t save the hyperlink properly when I updated the name. There isn’t a way that I’m aware of to stop that behavior in Windows without leveraging some kind of tool, code, or program. Aside from DisplayFusion and keystrokes to restore window positioning, PersistentWindows is a program a developer came up with:   https://github.com/kangyu-california/PersistentWindows 

What is PersistentWindows?
A poorly named utility that persists window positions and size when the monitor display count/resolution adjusts and restores back to it’s 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.” 
Technical Support Specialist
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Will check it out! Thanx!
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
Hi Jazz,
Thanks for the reference to my article — much appreciated!


Hi Jana,
First, thanks for the kind words!

There are two approaches to solving the problem...keeping the windows from moving in the first place (ideal!) or putting them back easily and quickly after they have moved (less than ideal, but better than having to move them manually).

What I'd like to understand is why they are moving when you come back from sleep. My guess (and that's all it is...a guess) is that the laptop, along with W10, wakes up before the external monitor wakes up, so W10 thinks that it is in a one-display configuration and places the windows accordingly...on the only display that it has at the time...the laptop screen. When the external monitor comes online milliseconds later, it's too late...W10 has already placed the windows.

If that reasoning is correct, one solution is to stop letting the laptop go to sleep...keep it running and let the screensaver kick in (that's what I do with my laptop and external monitors).

If you don't like that idea, another idea is to hibernate instead of sleep, but a big caveat on that...I don't know if it will work any better than sleep...just another guess on my part (in addition to never using sleep, I never use hibernate). My thinking on this one is that hibernate takes longer to restore, since it's coming from disk instead of RAM. During that extra time, the external monitor may wake up before W10 is ready to restore the windows, so by the time W10 places the windows, it detects the two-display configuration.

If none of that works (or appeals to you) and you can't keep the windows properly placed, then you'll need the second approach...putting them back easily and quickly. I already have such a solution that I developed (it leverages the code that is in the article that Jazz referenced), but it is for my own personal use...very rough around the edges and no documentation...not something ready to be shared (yet). I developed it because when I start W10, I want a whole bunch of programs to be opened, sized, and placed in their proper positions in a configuration with three external monitors. I call the program StartMan (stands for Start Manager). After using it for a while, I enhanced StartMan to have a Close option so that I can close all those same programs easily and quickly in preparation for shutting down W10. Lastly, I added a Move option, so that if the locations of windows ever get messed up, I can restore them easily and quickly (a few mouse clicks). If you find no other solution, I'll look into what it would take to make StartMan suitable for distribution (but no promises).

In conclusion, I think the best idea is to stop letting the laptop sleep...just have the screensaver kick in.

Regards, Joe

Author

Commented:
Hi Joe,
 
so W10 thinks that it is in a one-display configuration and places the windows accordingly…When the external monitor comes online milliseconds later, it's too late
Yes, makes sense
 
stop letting the laptop go to sleep
 
I can’t because it gets hot sometimes and the CPU overheats – sometimes I have to move and the laptop is just there (prior to setting to sleep, I just hibernate when I left, but most of the times I forget – thus, the “sleep” settings)
 
I haven’t gone into your link referred by Jazz, but will.
(it really makes sense that when w10 wakes, the external monitor takes time to react thus w10 thinks the monitor at hand is only its laptop screen)

Maybe there is a way or registry entry to work with the time the external monitor is detected by w10?

Author

Commented:
Just wanted to point out that I also found a supposedly solution to the problem, but didn't work "Allow this device to wake the computer " - https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware/dual-monitor-windows-10-not-working-properly-after/738d2ac5-742c-4991-9154-866ad57b0d3f

FYI

Author

Commented:
Is there is a way or registry entry to work with the time the external monitor is detected by w10?  
(I did noticed what Joe said is true "external monitor comes online milliseconds later, it's too late " - when I click or press a key, the notebook screen displays the login, then after a bit of time, the external monitor shifts and display the login screen)

Author

Commented:
Ok, got it!  The apps I forgot the name was FancyZones  ( https://insider.windows.com/en-us/articles/announcing-the-first-preview-and-code-release-of-powertoys).  Supposedly has a layout of the monitor - will check it out also later on the day.

FYI guys (if u have used and doesn't work, please let me know as to not waste that time ... Thanx!)
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
Hi Jana,

> but most of the times I forget – thus, the “sleep” settings

Change the setting to hibernate instead of sleep...if, of course, it works when coming out of hibernation...does it?

> I haven’t gone into your link referred by Jazz, but will.

As is, it does only half of what you want...it moves the windows to the other display, but all windows go to the same X/Y coordinates...you would have to position them manually on the other display after my program moves them. Note this comment there (and my reply to it):

https://www.experts-exchange.com/articles/33613/How-to-move-all-windows-on-one-monitor-to-another-monitor-with-a-single-keystroke.html#c2539987

That's what StartMan is all about...it allows specification of the X/Y coordinates (as well as height and width) for each program/window that it moves.

> Maybe there is a way or registry entry to work with the time the external monitor is detected by w10?

I don't know of one.

> didn't work "Allow this device to wake the computer"

There is a second suggestion there..."Allow this computer to turn off this device to save power"...did you try that one? My guess is that it is already un-ticked (and even grayed-out), but it's worth a look.

> Is there is a way or registry entry to work with the time the external monitor is detected by w10?

I don't know of one.

> the notebook screen displays the login, then after a bit of time, the external monitor shifts and display the login screen

Here's an idea...don't log in the first time. Enter a bad password on purpose...maybe W10 will re-detect the display environment and know that there are two. I have no idea if that will work...worth a try.

> FancyZones

Never used it...never even heard of it.

Regards, Joe
BasheerptIT Technical Support

Commented:
Needless to mention, in case you missed. Have you updated the drivers of Monitor and Display adapter to the latest version? Power management features may improved in the latest versions of drivers.

Author

Commented:
Ji Joe,
 
  • Tried the hibernate, same results.
  •  Tried "Allow this computer to turn off this device to save power", same results
  •  Tried "enter a bad password on purpose...maybe W10 will re-detect …", same results
 
Hi Basheerpt,
 
  • Yes, all updated
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
Hi Jana,

Since all of that fails, I return to the do-not-sleep-or-hibernate idea. You said that you can't leave it on "because it gets hot sometimes and the CPU overheats"...how about a cooling pad or fan for it, such as:
https://www.amazon.com/Temperature-Auto-Temp-Detection-2600-5000RPM-Nintendo/dp/B01NACVLWM/
https://www.amazon.com/Laptop-Cooling-15-6-17-Control-Portable-dp-B07QKR6MB8/dp/B07QKR6MB8/

If you don't like that idea, then we're back to the approach of easily/quickly restoring the locations of the windows after W10 has put them on the wrong display. Have you tried FancyZones? As I mentioned earlier, I never heard of it, but a quick web search showed that it is included in the latest W10 PowerToys here:
https://github.com/Microsoft/powertoys/releases

Worth a spin. Regards, Joe

Author

Commented:
Hi Joe,

As in entry, I tried your Hibernation recommendation and it also failed.

Not yet tried FancyZones, will do at the end of day.
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
> Hibernation recommendation and it also failed

Yes, I got that the first time you said it, which is why I recommended returning to the do-not-sleep-or-hibernate idea along with a cooling pad or fan to address the overheating issue; or returning to the idea of easily/quickly restoring the locations of the windows after W10 has put them on the wrong display.

> will do at the end of day

OK, let me know how it goes.

Author

Commented:
Oh ok, I misread; thought recommended hibernate again, sorry.

Ok will let u know
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
Sounds good.

Author

Commented:
Update:

Installed FancyZones and it doesn't work.  As soon as I log on, all is in the primary monitor distorted.

However, I think it does something similar as your apps Joe.  Since one create a layout, when logging back in, one drags the apps to the pre-configured highlight location.

Anyways, no luck on this.  And incredible no solution because there tones of links discussing this problem.

Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
Did you try PersistentWindows?

Author

Commented:
No.  Totally forgot, but will do.

Author

Commented:
Hi Jazz, just wanted to let u know PersistentWindows worked! Though there is a lag but as soon as I login, it does place all windows in the place I had them!

Thanx!
Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
Awesome! You’re welcome!

Author

Commented:
Pretty much impressed! It's been working great!

Author

Commented:
But did noticed certain apps does work.  For example Intel Extreme Tuning Utility and CPUID HWMonitor.

I noticed these 2 apps when run requires admin rights (User Account Control).

Author

Commented:
Just tested opening Windows Explorer with "run administrator" and didn't work.  

So it seems that if an apps run with admin rights, it will not succumbs to PersistentWindows.

If u have an advice, greatly appreciated.
Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:
The developer(s) maintaining PersistentWindows has been addressing issues/questions still you could report it on the GitHub page as a New Issue and he’ll see it. Perhaps he knows of a way or could implement a fix for that at the below link. You’ll just need to create a GitHub user account if you don’t have one already to report the problem you’re encountering:

https://github.com/kangyu-california/PersistentWindows/issues

Author

Commented:
Thanx!
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
> So it seems that if an apps run with admin rights, it will not succumbs to PersistentWindows.

Try running PersistentWindows elevated, i.e., right-click on its EXE or the shortcut to it and select Run as administrator.

Author

Commented:
Yeah, thanx! didn't think of that! (that's why u guys the experts)
Jazz KaurTechnical Support Specialist
CERTIFIED EXPERT

Commented:

That should work. Forgot they have a Power User Tip section on the main GitHub page and it mentions it here:

“Some applications (such as Task Manager, Event Viewer etc) require running PersistentWindows with admin privilege to fully recover window layout”
Joe WinogradDeveloper
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2018

Commented:
Ah, thanks for that, Jazz...I was just guessing. :) That makes it definitive. Regards, Joe

Author

Commented:
And it did work!

Thanx!!!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.