Windows lose focus, seemingly at random

Anonymous
2009-11-23T19:36:32+00:00

Since upgrading from Vista Business to 7 Business, I've run into an intermittent issue. Windows seem to lose focus at random. It may be happening more than I realize, since I have to be actively using the window to notice when it stops accepting my input. For instance, I might be scrolling to the bottom of a web page when I realize that moving the scroll wheel on my mouse no longer has any effect, or I might be typing something in Word while looking away from the screen, only to realize upon looking back that half of the sentence I'd typed was ignored because of a shift in focus. If I'm reading a particularly long web page, I'll occasionally notice the color of the transparent title bar change slightly when the focus changes, as though I'd clicked over to another program. I haven't been able to figure out what is stealing the focus whenever this happens, and it's a new occurrence under 7. Unfortunately, it's sporadic enough that trying to turn off programs running in the background to determine if they're the cause may prove kind of tricky. Has anyone else run into anything like this? If so, any fixes? I have a feeling the culprit may be the GMail Notifier or Trillian Astra, since they both pop up notices from time to time, but many (if not all) of those notices typically don't cause problems.

Any help you can offer would be great.

Windows for home | Previous Windows versions | Accessibility

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Anonymous
2009-11-24T13:55:20+00:00

Hey karpar,

Any third party software conflicting with Windows components can result to this behavior. Hence, putting your system in clean boot state can help in determining the culprit application or program. A clean boot loads only those files and programs that are absolutely required by the Operating System. Upon determining the background application causing the issue, you may contact the vendor for assistance.

Steps to perform clean boot:

1)       Click Start, type msconfig in the Start Search box, and then press ENTER.

2)       If you are prompted for an administrator password or for a confirmation, type the password, or click Continue.

3)       On the General tab, click Selective Startup.

4)       Under Selective Startup, click to clear the Load Startup Items check box.

5)       Click the Services tab, click to select the Hide All Microsoft Services check box, and then click Disable All.

6)       Click OK.

7)       When you are prompted, click Restart.

After the computer starts, test and see whether the sporadic behavior of Windows loosing focus continues.

If not, we definitely know for sure that the behavior is contributed by third party software conflicts.

To determine which application, follow the steps mentioned in the article below.

How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

http://support.microsoft.com/kb/929135

After you determine the startup item or the service that causes the problem, contact the program manufacturer to determine whether the problem can be resolved

Having done so, don’t forget to return your computer to start normally.

Reset the computer to start as usual

1)       Click Start, type msconfig.exe in the Start Search box, and then press ENTER.

2)       If you are prompted for an administrator password or for confirmation, type your password, or click Continue.

3)       On the General tab, click the Normal Startup option, and then click OK.

4)       When you are prompted to restart the computer, click Restart.

Hope this resolves the issue.


Regards,

Shinmila H - Microsoft Support

Visit our Microsoft Answers Feedback Forumand let us know what you think

Was this answer helpful?

90+ people found this answer helpful.
0 comments No comments

74 additional answers

Sort by: Most helpful
  1. Anonymous
    2013-04-30T13:54:01+00:00

    Great. Thanks.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-04-27T10:12:42+00:00

    Any chance of a compiled version of this code ?

    Thanks

    excuse me for late, here u r :

    https://docs.google.com/file/d/0B4HWdBF-sHsydWNJVDdUOGlYV28/edit?usp=sharing

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2013-04-22T11:29:37+00:00

    Any chance of a compiled version of this code ?

    Thanks

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-04-18T05:55:07+00:00

    It seems to be wermgr.exe (Windows Problem Reporting) running and then exiting at random times. It could be that there's a program running and then crashing.

    Maybe Microsoft can use this to help track down the issue.

    hi

    i had a same problem. and there was not any idea to what its reason.

    for solve this problem i wrote a little application to show the name and PID of active process.

    after running this application, i found the application witch got focus,was "Windows Problem Reporting".

    if you have a same problem, simply can run this application and check its result.

    using System;

    using System.Diagnostics;

    using System.Runtime.InteropServices;

    using System.Threading;

    namespace Get_Active_Process

    {

        class Program

        {

            [DllImport("user32.dll")]

            private static extern IntPtr GetForegroundWindow();

            [DllImport("user32.dll")]

            private static extern Int32 GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);

            private static Process GetActiveProcess()

            {

                IntPtr hwnd = GetForegroundWindow();

                return hwnd != null ? GetProcessByHandle(hwnd) : null;

            }

            private static Process GetProcessByHandle(IntPtr hwnd)

            {

                try

                {

                    uint processID;

                    GetWindowThreadProcessId(hwnd, out processID);

                    return Process.GetProcessById((int)processID);

                }

                catch { return null; }

            }

            static void Main(string[] args)

            {

                            while (true)

                {

                    Process activeProcess = GetActiveProcess();

                    if (activeProcess != null)

                    {

                        if (activeProcess.Id != Process.GetCurrentProcess().Id)

                        {

                            Console.WriteLine("PID=" + activeProcess.Id + "\nTitle="+ activeProcess.MainWindowTitle);                       

                        }

                    }

                    Thread.Sleep(10);

                }

            }

        }

    }

    Was this answer helpful?

    0 comments No comments