Microsoft KB Archive/279713

= Explorer.exe Hangs on ALT+F4 If Shutdown Restrictions Are in Use =

Article ID: 279713

Article Last Modified on 2/21/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q279713



SYMPTOMS
When you click the desktop and then press ALT+F4, you may receive the following message in a Restrictions dialog box:

This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.

This is the expected behavior if the &quot;Disable and remove the Shut Down command&quot; policy restriction has been applied to your computer. This policy is commonly used on computers that run Terminal Services, to prevent individual users from shutting down the whole server.

However, you may not be able to dismiss the Restrictions dialog box by pressing ENTER or ESC, or by clicking OK, because the dialog box does not respond. This results in a hung session. When this occurs, you may not be able to regain access to the desktop and the Start menu to log off cleanly.

This problem may appear to be intermittent, in that the Restrictions dialog box is sometimes active and can be dismissed, and sometimes it is inactive and cannot be dismissed.

This problem can affect both Terminal Services client sessions and the main console session on Windows 2000 Server, Windows 2000 Advanced Server, and Windows 2000 Professional.



CAUSE
This problem is caused by the interaction of two windows and their window procedures to process incoming messages in Explorer.exe.

The System Tray window is responsible for processing shutdown commands, and for displaying the Restrictions dialog box if a user attempts to shut down the computer when the Shut Down command is disabled through a policy. If the Desktop window has the focus and it receives the ALT+F4 key combination, it passes a Shut Down message to the System Tray window, because the System Tray window is responsible for processing this command.

If the mouse pointer is located over the Restrictions dialog box when it is first displayed, focus is given to the Restrictions dialog box, and it is active and can be dismissed. However, if the mouse pointer is not over the Restrictions dialog box when it is first displayed, the Desktop window retains the focus, and further messages are routed initially to the Desktop window, which is expected to route them to the System Tray window for routing to the dialog box.

The problem occurs because the Desktop window uses a synchronous SendMessage call to notify the System Tray window of the Shut Down command. This results in a deadlock situation.

The Desktop window is blocked on the SendMessage call until the System Tray window finishes its Shut Down message processing, and cannot send further messages to the System Tray window until it is unblocked. However, the System Tray window cannot complete its Shut Down message processing and unblock the SendMessage call until it receives messages routed through the Desktop window to dismiss the dialog box.

The solution is to modify the Desktop window procedure to use the asynchronous PostMessage function to notify the System Tray window of a shutdown command. Because PostMessage returns immediately and does not block, this allows the Desktop window to route subsequent messages to the System Tray window and the Restrictions dialog box, which is therefore always active and can be dismissed.



RESOLUTION
To resolve this problem, obtain the latest service pack for Windows 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

260910 How to Obtain the Latest Windows 2000 Service Pack

The English version of this fix should have the following file attributes or later:   Date        Time     Version         Size       File name - 12/19/2000   10:28p   5.0.3315.1000  2,337,040   Shell32.dll



WORKAROUND
To avoid this problem entirely, always use the Log Off command on the Start menu to end your session, instead of press ALT+F4 when the desktop has the focus.

If the problem has already occurred, it may be possible in some (but not all) cases to activate and dismiss an inactive Restrictions dialog box by following these steps:
 * 1) Click the OK button in the dialog box, make sure that the mouse pointer is still over the OK button, and then press CTRL+ALT+DELETE if you are working on the console, or press CTRL+ALT+END if you are working in a Terminal Services client window.
 * 2) In the resulting Windows Security dialog box, press either ESC to cancel the dialog box and return to the desktop, or press T to return to the desktop and run Task Manager.
 * 3) When you are returned to the desktop, the Restrictions dialog box may have been dismissed, or you may be able to dismiss the dialog box by clicking the OK button.

Because of timing considerations, this procedure may not work in all situations.

If you cannot dismiss the dialog box, the only way to regain control is to log off by pressing CTRL+ALT+DELETE on the console, or CTRL+ALT+END in a Terminal Services client window, and then click Log Off in the resulting Windows Security dialog box. You should then be able to log on again and resume work.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Windows 2000 Service Pack 3.



MORE INFORMATION
For additional information about how to obtain a hotfix for Windows 2000 Datacenter Server, click the article number below to view the article in the Microsoft Knowledge Base:

265173 The Datacenter Program and Windows 2000 Datacenter Server Product

For additional information about how to install multiple hotfixes with only one reboot, click the article number below to view the article in the Microsoft Knowledge Base:

296861 Use QChain.exe to Install Multiple Hotfixes with One Reboot

For additional information about how to install Windows 2000 and Windows 2000 hotfixes at the same time, click the article number below to view the article in the Microsoft Knowledge Base:

249149 Installing Microsoft Windows 2000 and Windows 2000 Hotfixes

Additional query words: kbShell

Keywords: kbhotfixserver kbqfe kbbug kbfix kbshell kbwin2000presp3fix kbwin2000sp3fix KB279713

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.