Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
2.2 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. HideTaskBar.cpp
  5. Abstract:
  6. The WS_EX_CLIENTEDGE flag means that the taskbar gets shown on NT. This
  7. isn't always what's desirable.
  8. Notes:
  9. This is a general purpose shim.
  10. History:
  11. 04/07/2000 linstev Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(HideTaskBar)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(CreateWindowExA)
  18. APIHOOK_ENUM_ENTRY(CreateWindowExW)
  19. APIHOOK_ENUM_END
  20. /*++
  21. Remove invalid Windows 2000 style bits from dwExStyle mask before calling
  22. CreateWindowEx.
  23. --*/
  24. HWND
  25. APIHOOK(CreateWindowExA)(
  26. DWORD dwExStyle,
  27. LPCSTR lpClassName,
  28. LPCSTR lpWindowName,
  29. DWORD dwStyle,
  30. int x,
  31. int y,
  32. int nWidth,
  33. int nHeight,
  34. HWND hWndParent,
  35. HMENU hMenu,
  36. HINSTANCE hInstance,
  37. LPVOID lpParam
  38. )
  39. {
  40. // Remove the client edge style.
  41. dwExStyle &= ~WS_EX_CLIENTEDGE;
  42. return ORIGINAL_API(CreateWindowExA)(
  43. dwExStyle,
  44. lpClassName,
  45. lpWindowName,
  46. dwStyle,
  47. x,
  48. y,
  49. nWidth,
  50. nHeight,
  51. hWndParent,
  52. hMenu,
  53. hInstance,
  54. lpParam);
  55. }
  56. /*++
  57. Remove invalid Windows 2000 style bits from dwExStyle mask before calling
  58. CreateWindowEx.
  59. --*/
  60. HWND
  61. APIHOOK(CreateWindowExW)(
  62. DWORD dwExStyle,
  63. LPCWSTR lpClassName,
  64. LPCWSTR lpWindowName,
  65. DWORD dwStyle,
  66. int x,
  67. int y,
  68. int nWidth,
  69. int nHeight,
  70. HWND hWndParent,
  71. HMENU hMenu,
  72. HINSTANCE hInstance,
  73. LPVOID lpParam
  74. )
  75. {
  76. dwExStyle &= ~WS_EX_CLIENTEDGE;
  77. // Call the original API
  78. return ORIGINAL_API(CreateWindowExW)(
  79. dwExStyle,
  80. lpClassName,
  81. lpWindowName,
  82. dwStyle,
  83. x,
  84. y,
  85. nWidth,
  86. nHeight,
  87. hWndParent,
  88. hMenu,
  89. hInstance,
  90. lpParam);
  91. }
  92. /*++
  93. Register hooked functions
  94. --*/
  95. HOOK_BEGIN
  96. APIHOOK_ENTRY(USER32.DLL, CreateWindowExA)
  97. APIHOOK_ENTRY(USER32.DLL, CreateWindowExW)
  98. HOOK_END
  99. IMPLEMENT_SHIM_END