TaskKeyMgr.h 982 B

12345678910111213141516171819202122232425262728293031
  1. ////////////////////////////////////////////////////////////////
  2. // MSDN Magazine -- September 2002
  3. // If this code works, it was written by Paul DiLascia.
  4. // If not, I don't know who wrote it.
  5. // Compiles with Visual Studio 6.0 and Visual Studio .NET on Windows XP.
  6. //
  7. #pragma once
  8. #include "TaskKeyHook.h"
  9. //////////////////
  10. // Use this class to disable task keys, task manager and/or the taskbar.
  11. // Call Disable with flags for items you want to disable; for example:
  12. //
  13. // CTaskMgrKeys::Disable(CTaskMgrKeys::ALL);
  14. //
  15. class CTaskKeyMgr {
  16. public:
  17. enum {
  18. TASKMGR = 0x01, // disable task manager (Ctrl+Alt+Del)
  19. TASKKEYS = 0x02, // disable task keys (Alt-TAB, etc)
  20. TASKBAR = 0x04, // disable task bar
  21. ALL=0xFFFF // disable everything :(
  22. };
  23. static void Disable(DWORD dwItem,BOOL bDisable,BOOL bBeep=FALSE);
  24. static BOOL IsTaskMgrDisabled();
  25. static BOOL IsTaskBarDisabled();
  26. static BOOL AreTaskKeysDisabled() {
  27. return ::AreTaskKeysDisabled(); // call DLL
  28. }
  29. };