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

swinchester4

New member
Local time
4:23 PM
Messages
6
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 Computer My Computer

At a glance

Windows 7
OS
Windows 7
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 Computer My Computer

At a glance

Windows 7 Ultimate x64Intel Core i5-2500 3.3GHz8GB DDR3 1333MHzOn-board
Computer Manufacturer/Model Number
CreepinJesus Mk. IV
OS
Windows 7 Ultimate x64
CPU
Intel Core i5-2500 3.3GHz
Motherboard
Asus P8H67-M PRO
Memory
8GB DDR3 1333MHz
Graphics Card(s)
On-board
Sound Card
On-board
Monitor(s) Displays
Samsung SyncMaster BX2250 22.5" LED-backlit LCD
Screen Resolution
1920 * 1080
Hard Drives
OCZ Agility 3 120GB, SATA-III
PSU
Thermaltake Toughpower Grand TPG-650M
Case
Lian-Li PC-A04
Cooling
Standard fans. They blow.
Keyboard
Logitech K360
Mouse
Generic Logitech from the bargain-bin by the checkout
Internet Speed
Over 9000! ...Mbps.
Other Info
Chocolate digestives are my favourite biscuit.
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 Computer My Computer

At a glance

Windows 7 Ultimate X64 SP1Intel i5-2550K, Differing ~4.4-4.8GHz No buil...16GB G.Skill Sniper 1866MHz @ 2133MHz 2x8GBASUS GTX650TIB-DC2OC-2GD5, (650TI Boost)
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home Built Desktop By DataTech
OS
Windows 7 Ultimate X64 SP1
CPU
Intel i5-2550K, Differing ~4.4-4.8GHz No built in GPU
Motherboard
ASUS P8Z68-V PRO/GEN3
Memory
16GB G.Skill Sniper 1866MHz @ 2133MHz 2x8GB
Graphics Card(s)
ASUS GTX650TIB-DC2OC-2GD5, (650TI Boost)
Sound Card
Onboard Realtek 5-1
Monitor(s) Displays
Samsung P2570HD
Screen Resolution
1920x1080
Hard Drives
Samsung 840 Pro 256GB SSD for OS, 500GB Seagate Constellation (Enterprise drive) for Data
PSU
Corsair HX650W
Case
Inwin Dragon Rider
Cooling
Hyper 212 EVO w/two Noctua fans, push-pull, @1300 RPM
Keyboard
E-Z Eyes, bright yellow keys with large characters
Mouse
steelseries SENSEI Laser Pro Gaming
Internet Speed
48-51Mbs Mbs down, 11 Mbs up Xfinity Cable
Antivirus
Norton Internet Security 2013
Browser
IE 10, Opera, Pale Moon if needed
Other Info
4 case fans, LG BluRay-RE, ASUS DVD-RW, Mr. Fusion power supply, 1.21 gigawatts.
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 Computer My Computer

At a glance

Windows 7
OS
Windows 7
.....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 W7, XP, W2k. My testing in Vista and W98 seemed to show that the taskbar never enters the window z-order stack.
 

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
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 Computer My Computer

At a glance

Windows 7
OS
Windows 7
........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 W7 desktop and maybe that will be your work around: make/use desktop shortcuts for your most frequented apps.
 

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
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 Computer My Computer

At a glance

Windows 7
OS
Windows 7
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 W7. Thanks for sharing that... maybe others will find your thread if this drives them crazy.
 

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
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 Win7.

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 Computer My Computer

At a glance

Windows 7
OS
Windows 7
No problem. Glad it is working more to your liking now.

Thanks for posting back with our findings.
 

My Computer My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
This issue is still creating problems for me.

The issue has improved somewhat since making the Registry setting change, but it hasn't gone away.

Is it possible to file a bug-report with Microsoft about this issue? Doesn't this bother other users? This issue is so bad I find using Windows a major pain because I'm constantly having to get the window to have focus before I can do anything with it.

Any advice you have I'd be thankful for :)
 

My Computer My Computer

At a glance

Windows 7
OS
Windows 7
.....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 W7, XP, W2k. My testing in Vista and W98 seemed to show that the taskbar never enters the window z-order stack.


I realise this is an old thread, however a search reveals no other threads about this exact issue (although, there are plenty of threads related to similar issues regarding stealing of focus - but not this exact issue).

So the problem is exactly as UsernameIssues above has explained it - when clicking in the taskbar to launch an application, the taskbar becomes the last thing to have focus, and therefore when closing the window that was opened from the taskbar, the taskbar grabs focus, since the taskbar is the last thing to have focus.

The taskbar should not be grabbing focus, there is literally no reason why the taskbar needs to have focus. Focus should be handed to the last window that had focus!.

So, is there any way to completely obliterate the stupid taskbar from having focus? Perhaps some registry setting that disables the taskbar from ever getting focus?
 

My Computer My Computer

At a glance

7 x64 Ultimate
Computer type
PC/Desktop
OS
7 x64 Ultimate
Back
Top