Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: how do I get the top-most window to always grab focus?


21 Feb 2012   #1

Windows 7
 
 
how do I get the top-most window to always grab focus?

I just got a new computer and it has Windows 7. Windows 7 is driving me nuts because the top-most window will not automatically get focus. For example, say I have Windows-Explorer and Notepad open. I have Notepad focused and am working in it. I then close Notepad, which leaves Windows-Explorer as the only open window on the desktop. Yet the Windows-Explorer window will not automaticlaly get focus. Instead it is "greyed" out and the only way I can focus it is to click on the window. This is so ANNOYING.

Also, when I assign a keyboard shortcut (e.g., to open Internet Explorer if I assign Ctrl+Alt+I), it will never open with focus. It will open the app but it will be "greyed out" and it will not get focus until I click on it.

This never happened on Windows XP. On XP the top-most window would always get focus if there was no window "above it" or if the window "above it" was closed.

Is there any way to get Windows 7 to behave like Windows XP with windows getting focus?

My System SpecsSystem Spec
.

22 Feb 2012   #2

Windows 7 Ultimate x64
 
 

When you close a program, focus returns to wherever it was before you focussed on the program you just closed. However, the problem here is if you have Explorer open, for example, open Notepad with the Start menu, then close Notepad, focus returns to the Start menu / taskbar because that's where it was last.

There's an option in the Ease of Access settings to have it focus on whatever the mouse is hovering over, if that helps - go to Ease of Access > Make the mouse easier to use, then check 'Activate a window by hovering over it with the mouse'.
My System SpecsSystem Spec
22 Feb 2012   #3
Microsoft MVP

Windows 7 Ultimate X64 SP1
 
 

Welcome to Seven Forums swinchester4. Here is where CJ meant to go:
Control Panel\All Control Panel Items\Ease of Access Center.
You can find several settings there which can make Win 7 easier to use.
My System SpecsSystem Spec
.


22 Feb 2012   #4

Windows 7
 
 

Quote   Quote: Originally Posted by CreepinJesus View Post
When you close a program, focus returns to wherever it was before you focussed on the program you just closed. However, the problem here is if you have Explorer open, for example, open Notepad with the Start menu, then close Notepad, focus returns to the Start menu / taskbar because that's where it was last.
This is not true. You can prove it: open Notepad and type a few letters. Then open Internet Explorer. Now close Internet Explorer. The focus does not return to Notepad. The focus also does not land on the Taskbar--I can't use the cursor keys to move across the taskbar. The focus is in never-never-land until I click on a window. When testing this, I am not opening anything from the Start menu. Everything I open is on the Taskbar.

I can't believe people can live with this bug. It is driving me nuts.

Thanks for posting about the Control Panel setting but I was already aware of this. It doesn't solve the problem because my mouse won't necessarily be positioned over the top most window when I close something else.
My System SpecsSystem Spec
22 Feb 2012   #5

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by swinchester4 View Post
.....You can prove it: open Notepad and type a few letters. Then open Internet Explorer. Now close Internet Explorer. The focus does not return to Notepad......

open Notepad
okay, I did that via the start menu


type a few letters
okay, I typed a few letters into the notepad editor


Then open Internet Explorer
okay, but to do that I clicked on the IE shortcut that is pinned to the taskbar and therein lies the problem: I have now made an entry in the window Z order stack for the taskbar.


Now close Internet Explorer
okay, I've closed IE and the focus reverts to the last item that was in focus - the taskbar.


To prove this z-order to yourself:
open notepad
open IE
click on notepad to bring it into focus
click in IE to bring it into focus
close IE
notepad should now be in focus

I do not know if this is behavior can be changed based on the theme settings, but my quick testing indicates that the taskbar (or quick launch area) is a part of the window z-order stack for Windows 7, XP, W2k. My testing in Vista and W98 seemed to show that the taskbar never enters the window z-order stack.
My System SpecsSystem Spec
22 Feb 2012   #6

Windows 7
 
 

Thanks for illustrating this for me.

This is the most retarted design because once the focus is on the taskbar you still can't use the cursor keys to navigate it.

I would be grateful if you figure out a way to take the taskbar out of the z-order stack that you would post the how-to here. I still have a Windows XP machine and it does not behave this way. So I assume there has got to be some way to make Windows 7 not do this.
My System SpecsSystem Spec
22 Feb 2012   #7

W7 Pro SP1 64bit
 
 

Quote   Quote: Originally Posted by swinchester4 View Post
........I still have a Windows XP machine and it does not behave this way.........
All 4 of the XP computers that I just tested included the taskbar in the windows z-order... even if I change the themes around. So the key to making this happen for you lies in figuring out how your XP system is setup... or figuring out how you are opening things on that XP system.

On your XP system:
open notepad via the start menu
(do not use an OS shortcut key)
(do not use a shortcut on the desktop)

open IE via the start menu
(do not use an OS shortcut key)
(do not use a shortcut on the desktop)
(do not use a shortcut on the quick launch toolbar)

close IE via Alt-F4
close notepad via Alt-F4

For me, attempting to close notepad via Alt-F4 brings up the windows shut down dialog box because notepad was not in focus.

Again on the XP system, if you make a desktop shortcut for notepad and IE, and repeat the steps above using those desktop shortcuts, you may find that the desktop is not added to the windows z-order stack. The same is true for a Windows 7 desktop and maybe that will be your work around: make/use desktop shortcuts for your most frequented apps.
My System SpecsSystem Spec
24 Feb 2012   #8

Windows 7
 
 

Okay.

First, I tested my Windows XP machine and it does NOT behave the same way the 7 machine does. The top window on my XP machine always gets focused. Even when doing your "experiment"

Second: I think I solved the problem on my 7 machine. I edited the registry the ForegroundLockTimeout entry I think. I set it to zero and now 7 is behaving how I want.

But here's the funny part. I checked my XP machine and the ForegroundLockTimeout registry setting is the default setting (ie, the setting that I don't like on the 7 machine). So I have no idea why the XP machine is behaving different than the 7 machine. By the way, I checked three other XP machines at work and ALL of them behave the same as my XP machine--they all give focus to the top most window yet have the default ForegroundLockTimeout registry setting. So something else has got to be at work here on the XP machines. I'd still like to find out what it is if possible. If you come across any more info on this, I'd be thankful if you posted what you learn.

Thanks!
My System SpecsSystem Spec
25 Feb 2012   #9

W7 Pro SP1 64bit
 
 

That is weird, I cannot find any XP computer that acts as you describe and I would not have thought that the registry key that you modified would have impacted this particular behavior in Windows 7. Thanks for sharing that... maybe others will find your thread if this drives them crazy.
My System SpecsSystem Spec
27 Feb 2012   #10

Windows 7
 
 

Okay, UsernameIssues, you are right afterall.

After some more experimentation I realized you are right and that things like using "Quicklists" in WinXP to launch the applications cause the windows to behave differently than launching the apps from a Taskbar Icon in Windows 7.

So you are absolutely correct. Thank you so much for your posts and help in my figuring this out. It was so kind of you

With the registry hack I made, Windows 7 is not behaving much much better and no longer giving me grief

Thanks again.
My System SpecsSystem Spec
Reply

 how do I get the top-most window to always grab focus?




Thread Tools



Similar help and support threads for2: how do I get the top-most window to always grab focus?
Thread Forum
window focus issues (windows 7 pro x64) General Discussion
window focus with mouse pointer General Discussion
window loses focus General Discussion
Focus is being lost on current window and goes nowhere General Discussion
Remote Desktop Window Losing Focus Network & Sharing
Window focus is stolen but doesn't go anywhere General Discussion
Window focus getting lost every few seconds General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 01:52 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33