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.

60 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. FakeThemeMetrics.cpp
  5. Abstract:
  6. This Shim will allow the Skemers group to shim applications that do not behave
  7. well with "Themed" system metrics
  8. History:
  9. 11/30/2000 a-brienw Converted to shim frame work version 2.
  10. --*/
  11. #include "precomp.h"
  12. #ifndef ARRAYSIZE
  13. #define ARRAYSIZE(x) sizeof(x)/sizeof((x)[0])
  14. #endif
  15. IMPLEMENT_SHIM_BEGIN(MSDevDisabledButtons)
  16. #include "ShimHookMacro.h"
  17. // Add APIs that you wish to hook to this enumeration. The first one
  18. // must have "= USERAPIHOOKSTART", and the last one must be
  19. // APIHOOK_Count.
  20. APIHOOK_ENUM_BEGIN
  21. APIHOOK_ENUM_ENTRY(GetSysColor)
  22. APIHOOK_ENUM_END
  23. DWORD APIHOOK(GetSysColor)(int nIndex)
  24. {
  25. if (nIndex == COLOR_MENU)
  26. return ORIGINAL_API(GetSysColor)(COLOR_BTNFACE);
  27. if (nIndex == COLOR_MENUBAR)
  28. return ORIGINAL_API(GetSysColor)(COLOR_BTNFACE);
  29. return ORIGINAL_API(GetSysColor)(nIndex);
  30. }
  31. /*++
  32. Register hooked functions
  33. --*/
  34. HOOK_BEGIN
  35. APIHOOK_ENTRY(USER32.DLL, GetSysColor)
  36. HOOK_END
  37. IMPLEMENT_SHIM_END