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.

68 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. MaxPayne.cpp
  5. Abstract:
  6. They try to size their window to the entire screen and use the wrong system
  7. metrics. This shim just redirects them to the ones they should be using so
  8. the taskbar doesn't flicker through into the game.
  9. This is not a Win9x regression, but since there is so much more activity in
  10. the task bar area on XP, it's much more noticable.
  11. Notes:
  12. This is an app specific shim.
  13. History:
  14. 07/31/2001 linstev Created
  15. --*/
  16. #include "precomp.h"
  17. IMPLEMENT_SHIM_BEGIN(MaxPayne)
  18. #include "ShimHookMacro.h"
  19. APIHOOK_ENUM_BEGIN
  20. APIHOOK_ENUM_ENTRY(GetSystemMetrics)
  21. APIHOOK_ENUM_END
  22. /*++
  23. Redirect SM_C?FULLSCREEN to SM_C?SCREEN.
  24. --*/
  25. int
  26. APIHOOK(GetSystemMetrics)(
  27. int nIndex
  28. )
  29. {
  30. if (nIndex == SM_CXFULLSCREEN) {
  31. nIndex = SM_CXSCREEN;
  32. } else if (nIndex == SM_CYFULLSCREEN) {
  33. nIndex = SM_CYSCREEN;
  34. }
  35. return ORIGINAL_API(GetSystemMetrics)(nIndex);
  36. }
  37. /*++
  38. Register hooked functions
  39. --*/
  40. HOOK_BEGIN
  41. APIHOOK_ENTRY(USER32.DLL, GetSystemMetrics)
  42. HOOK_END
  43. IMPLEMENT_SHIM_END