PC Help please... windows grabbing focus?!
PC Help please... windows grabbing focus?!
Author
Discussion

RobM77

Original Poster:

35,349 posts

264 months

Wednesday 3rd May 2006
quotequote all
It takes a lot to annoy me, but I am actually annoyed with my computer at the moment!

Does anyone here know how to stop windows in Microsoft Windows grabbing focus by themselves?

For example, imagine that you've got four internet explorer windows open and, let's say, a database running a report and you're also typing a letter into MS Word. You're browsing the web and you go to close the web browser, but just at that point the database finishes what it is doing and grabs focus just as you click close... so you've closed your report that took five minutes to produce instead of I.E... Then, the file you were uploading to hotmail.com finishes and that window grabs focus whilst you're touch typing a letter in Word, and you end up missing four sentences from the Word letter. You flick back to Word, but hotmail's got something else to tell you, so it's back to the mouse to go back to Word again!!

This happens to me all the time. Does anyone know how to stop it? Is there a registry setting or something?

Polarbert

17,936 posts

261 months

Wednesday 3rd May 2006
quotequote all
There should be a button on your computer with a power symbol on it. Hold it down for around 5 secs and that will stop it happening!



Let me know if you need help with anything else, I'm here all night.

King Herald

23,501 posts

246 months

Wednesday 3rd May 2006
quotequote all
RobM77 said:
It takes a lot to annoy me, but I am actually annoyed with my computer at the moment!

Does anyone here know how to stop windows in Microsoft Windows grabbing focus by themselves?

For example, imagine that you've got four internet explorer windows open and, let's say, a database running a report and you're also typing a letter into MS Word. You're browsing the web and you go to close the web browser, but just at that point the database finishes what it is doing and grabs focus just as you click close... so you've closed your report that took five minutes to produce instead of I.E... Then, the file you were uploading to hotmail.com finishes and that window grabs focus whilst you're touch typing a letter in Word, and you end up missing four sentences from the Word letter. You flick back to Word, but hotmail's got something else to tell you, so it's back to the mouse to go back to Word again!!

This happens to me all the time. Does anyone know how to stop it? Is there a registry setting or something?

I was scussing and swearing at the same thing this morning, as I rattled off a quick email reply and hit 'enter', then noticed that another page that was loading had finished and taken over, and what I'd written was now plastered in the middle of that document!

If I were real clever I could type and look at the screen at the same time, but I'm just a 'seek and poke' two finger merchant.

RobM77

Original Poster:

35,349 posts

264 months

Wednesday 3rd May 2006
quotequote all
It is of particular annoyance when I get in from work. I always load up both my hotmail accounts, Pistonheads, MSN Messenger and maybe a news page or something. I would then like to log into each one one by one. You can imagine the chaos as they all cut in over each other! I can't believe this is still in Windows as it is a serious flaw!

miniman

30,127 posts

292 months

Wednesday 3rd May 2006
quotequote all
You could try downloading the TweakUI Powertoy for XP from Microsoft.com - in the GeneralFocus area there's an option "prevent applications from stealing focus".

RobM77

Original Poster:

35,349 posts

264 months

Wednesday 3rd May 2006
quotequote all
miniman said:
You could try downloading the TweakUI Powertoy for XP from Microsoft.com - in the GeneralFocus area there's an option "prevent applications from stealing focus".


Wow. That sounds like just what I need. Sadly, on the Microsfot website they only offer a "TweakMCE" for "XP Media Centre Edition". I'm running XP home. Any ideas?

pmanson

13,388 posts

283 months

Wednesday 3rd May 2006
quotequote all
Rob.

Try this

GreenV8S

31,024 posts

314 months

Wednesday 3rd May 2006
quotequote all
In addition to the other tweaks etc, when you are closing windows try to get into the habbit of holding the mouse button down for long enough for the button to respond before you let go. That ensures that the event can only ever go to the window you are looking at even if another window pops up at the last moment. This is particularly relevent if you tend to have maximised windows so the 'close' buttons all appear in the same place.

By the way there is a windows XP registry setting that causes windows that want attention to flash their task bar icon instead of opening (I guess this is what the powertoys stuff uses) but it only works for applications that support it.

>> Edited by GreenV8S on Wednesday 3rd May 23:52

RobM77

Original Poster:

35,349 posts

264 months

Thursday 4th May 2006
quotequote all
Thanks very much. I'll install that add on soon!

GreenV8S said:
In addition to the other tweaks etc, when you are closing windows try to get into the habbit of holding the mouse button down for long enough for the button to respond before you let go.


I work too fast for that! The main thing that annoys me is the typing issue. Like when I'm typing this message now, I bet a window will flash up in a minute!!

thanks for all your help. That is one question answered!

Zad

13,020 posts

266 months

Thursday 4th May 2006
quotequote all
Don't be surprised if it doesn't work though. I tried the GUI Tools, reg hacks and all sorts but the only thing that sorted it was a fresh installation

TheExcession

11,669 posts

280 months

Thursday 4th May 2006
quotequote all
Have to admit this really bugs me. It normall catches me when I'm typing and a big download finishes... nothing worse than those keystrokes going into word suddenly translating to a 'Cancel Copying' on that 100MByte download.

RobM77 said:

...so it's back to the mouse to go back to...

ALT-TAB is a great way to switch between Apps without reaching for the mouse.
I too hate having to reach for the mouse to focus a diferent App, makes me cringe when I see other people doing it too... a bit like file save... via the mouse.... takes forever when generally CTL-S ot ALT-F & S do the same thing.

GreenV8S said:
...when you are closing windows try to get into the habbit of holding the mouse button down for long enough for the button to respond before you let go...
or use te keyboard and presss ALT-F4

There are heaps of other windows short cuts... I used to try and make a point of learnign and using a new one every week.

You'd be surprised how much quicker you can work when you aren't constantly reaching for the mouse.

When I used to teach a few friends to code HTML with Notepad I used to rest the mouse on top of the monitor... they weren't allowed to touch it except to edit images.

Everything else, copying, editing, moving files, viewing them in IE and Netscape all had to be done from the keyboard!

GreenV8S

31,024 posts

314 months

Thursday 4th May 2006
quotequote all
I use the keyboard instead of the mouse wherever possible, too. But on the issue of input events going to the wrong window the mouse has a definite advantage because of the way that mouse clicks are handled as two events with visual feedback between them. Once you are used to waiting for the control to react before you let go of the button, the delay is hardly noticeable. But it more than pays for itself when it stops you closing the wrong application window, or closing the dialog that just appeared as you went to close the window.

RobM77

Original Poster:

35,349 posts

264 months

Friday 5th May 2006
quotequote all
I actually major on keyboard shortcuts myself - but I was trying to make a point in my original e-mail I have been known to bend the truth to make a point before

King Herald

23,501 posts

246 months

Friday 5th May 2006
quotequote all

Watching endless videos here at work several of us have noticed that NOBODY uses the mouse in movies. Everybody can do wonderful things like zoom in on pictures, rotate views, enhance blurry pictures, call up different pages, translate documents, launch spaceships, etc etc all with a few machine gun ratatats on the keyboard.

Q, Why don't they ever use the mouse in movies?

dilbert

7,741 posts

261 months

Friday 5th May 2006
quotequote all
This shouldn't happen.

When you move the mouse over a window frame (non-client) windows sends an WM_NC_MOUSEMOVE to your app. If you click a button in the frame then you get a WM_NC_LBUTTONDOWN. The correct response to the LBUTTONDOWN by your app is to get the capture. Whilst your app has the mouse capture another app cannot activate. If this mechanisim was not in place then your app would never close, because to close the app has to receive a WM_LBUTTONUP (which is all windows can send if your app has the capture) in order to know when the close operation has occured.

Notice that if your sytem is working correctly that an app will not close until the mouse button has been lifted. And if you lift the mouse button elsewhere having pushed it on close, then the window does not close.

The thing is that windows cannot send user interface messages to another window whilst the current window has the capture.

This process garantees that your close intent can never close another window.

Focus is a different beast, and the wndow with the focus is not necassarily the one with the mouse capture. This is important, for example when you push a toolbar button.

Critically windows can become confused about which window has the focus, and this comes about when an application does not manage it's focus correctly. This happens most often when a window that is not in the foreground has the focus. If you click on any window, it will bounce to the foreground. But it's focus may not follow. This is because you may wish for the caret to stay in the view, whilst you click a toolbar button which it's self is a window.

If the app does not return the window with the focus to the foregound when the toolbar operation is complete, then you can end up with confusion.

When it comes to issues like these, particularly when you have windows that are children of a parent, but visually they are all siblings of each other (floating toolbars)), the problem is compounded. There isn't that much separation of applications from each other when it comes to these issues, and one offending app can cause normal ones to misbehave.

It's made worse because debuggers have their own problems. If you want to debug these problems, you have to be able to see the code you are working on. Unfortunately if you bring your code window to the foreground it upsets the erroneous focus state that the iffy application was in.

There are quite a few high profile applications that exhibit these faults, but you only notice if you use the keyboard alot.

HTH

>> Edited by dilbert on Friday 5th May 20:03