Article ID: 226359 - Last Review: November 21, 2006 - Revision: 4.3 How to disable task switching on Win32 platforms
This article was previously published under Q226359 On This PageSUMMARY
This article describes how to disable task switching and other system functions accessed through key combinations such as CTRL+ESC and ALT+TAB on Win32 Platforms.
Windows 95 and Windows 98Applications can enable and disable ALT+TAB and CTRL+ESC, for example, by calling SystemParametersInfo (SPI_SETSCREENSAVERRUNNING). To disable ALT+TAB and CTRL+ESC, set the uiParam parameter to TRUE; to enable the key combinations, set the parameter to FALSE:Windows NT 4.0 Service Pack 3 and Later and Windows 2000Applications can disable ALT+TAB or CTRL+ESC by installing a low-level keyboard hook. A low-level keyboard hook (WH_KEYBOARD_LL) is installed by calling SetWindowsHookEx. For more information on Window hooks see the "Hooks" overview in the Platform SDK documentation.The following is a sample low-level keyboard hook procedure that disables CTRL+ESC, ALT+TAB, and ALT+ESC: Windows NT 4.0 Service Pack 2 and Earlier, Windows NT 3.51 and EarlierApplications can disable CTRL+ESC system-wide by replacing the Windows NT Task Manager, but this is not recommended.Applications can disable ALT+TAB and ALT+ESC when the application is running by registering hotkeys for the ALT+TAB and ALT+ESC combinations by calling RegisterHotKey. MORE INFORMATION
Older development tools, such as Microsoft Visual C++ Version 5.0 and earlier, might not contain the header files necessary to build an application that uses low-level keyboard hooks. To obtain the most recent header files, download the latest Platform SDK from the following Microsoft Web site:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
(http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm)
Because low-level keyboard hooks are a feature specific to Windows NT 4.0 Service Pack 3 and later, define _WIN32_WINNT >= 0x0400 prior to including winuser.h (or windows.h).
APPLIES TO
| Other Resources Other Support Sites
CommunityArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top