Jump to content

Official Windows XP Tweaks Thread


Andrewr05

Recommended Posts

  • 3 months later...

How Do I Prevent Applications from Stealing Focus

 

By default Windows XP automatically prevents an application from stealing focus. You have probably already noticed this when you have had a number of applications minimised to the taskbar and one particular application has wanted you attention so the tab of the minimised application starts flashing. However, there have been cases where the minimised application tab refuses to flash when the application has attempted to grab focus. This is because an application you have installed has disabled the prevent an application from stealing focus option. To remedy the problem proceed as follows.

 

NOTE

 

For safety reasons it is always advisable to backup the registry before you start editing it. While there are numerous third party application that will do this for you, i.e., ERUNT, you can just as easily backup the registry using Windows XP.

 

1/ Click the Start button

2/ From the Start Menu click Run

3/ In the Run dialogue box type regedit

4/ When the registry window opens navigate to the following Registry key: HKEY_CURRENT_USER/ControlPanel/Desktop

5/ Click on the Desktop option and then look down the list on the right for the following: foregroundlocktimeout

6/ The right hand list is divided into three sections - Name Type and data.

7/ Look in the Data section and check that the following is present: 0x00030d40 (200000)

8/ If this data is present then the Prevent applications from stealing focus option is enabled.

9/ If you have something different then proceed as follows:

10/ Right click on the ForegroundLockTimeout option and select Modify

11/ The Edit DWORD value box opens

12/ Make sure there is a dot next to the hexadecimal option in the Base box

13/ Now in the Value data box type: 30d40 (that's thirty followed by d then followed by 40)

14/ Click the OK button

15/ Your entry should now read: ForegroundLockTimeout REG_DWORD 0x00030d40 (200000)

16/ You can get the offending windows to flash on the taskbar a number of times instead of popping up, the number of flashes is ForegroundFlashCount, make sure this is at least one, I think the default is 3

17/ Now close regedit and reboot your machine

Share this post


Link to post
Share on other sites

It is not so much a tweak, but may be helpful to some people here. It was making me really consider switching back to 2k pro :rolleyes: I think I now only have one more mystery issue to solve with XP.

 

Anyway, if you find Event Viewer giving you these sorts of messages when logging off, there is a "fix"! In my case, where I have roaming profiles on a domain, it meant that the profiles weren't being uploaded back to the server properly.

 

Event Type: Warning

Event Source: Userenv

Event Category: None

Event ID: 1517

Date: 11/05/2007

Time: 05:31:05 PM

User: NT AUTHORITY\SYSTEM

Computer: APE

Description:

Windows saved user PIE-NET\admin registry while an application or service was still using the registry during log off. The memory used by the user's registry has not been freed. The registry will be unloaded when it is no longer in use.

 

This is often caused by services running as a user account, try configuring the services to run in either the LocalService or NetworkService account.

 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

I am not really particularly impressed with the official cure for this problem at all, but it does seem to work at least, I guess. You can download a tool called 'UPHClean', which is a service that will run and check if anything is keeping the registry open after logoff.

 

http://www.microsoft.com/downloads/details...;displaylang=en

 

It can be installed, prompt free, during log on using a log on script. I don't know if it's any different with a proper Windows server and all that. I am using Samba, simple old poledit policies and a [rather complex set of] batch file(s) for a logon script. The "\\bone\netlogon\common\uphclean.msi" part will have to be changed to point to where ever you store the uphclean installer on your network, obviously.

 

if not exist "c:\program files\uphclean\uphclean.exe" ( 
echo Installing UPHClean...
msiexec /i \\bone\netlogon\common\uphclean.msi /passive
) else (
echo UPHClean is already installed.
)
echo.

 

After installing this uphclean.exe should be running in the background, and upon logging off you should see something like the following in event viewer:

 

Event Type: Information

Event Source: UPHClean

Event Category: None

Event ID: 1401

Date: 11/05/2007

Time: 05:39:10 PM

User: PIE-NET\admin

Computer: APE

Description:

The following handles in user profile hive PIE-NET\admin (S-1-5-21-4108042207-757625699-2779596519-5000) have been remapped because they were preventing the profile from unloading successfully:

 

svchost.exe (1036)

HKCU (0x1e0)

 

 

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

If it is a service causing the issue, as mine is, you can see which it is by running 'tasklist /svc' at a command prompt and looking for the process number in the list. This is 1036 in my case:

 

Image Name PID Services

========================= ====== =============================================

[snip snip]

svchost.exe 1036 DcomLaunch

[snip snip]

 

Apparently 'DcomLaunch' is rather important and shouldn't be stopped, so I am stuck with this UPHClean tool :(

 

Oh, and one more thing. Don't try and run the uninstaller while uphclean.exe is still running. It blue screens. What an amazing hack MS put out to solve this issue :rolleyes:

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...