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.

72 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. IgnoreZeroMoveWindow.cpp
  5. Abstract:
  6. This shim changes MoveWindow calls with zero-sized width &
  7. height parameters to a value of one. NBA Live 99 was failing
  8. due to an internal check. This implies that WIN9x does not allow
  9. zero size windows.
  10. Notes:
  11. This is an app specific for NBA Live 99
  12. History:
  13. 03/02/2000 a-chcoff Created
  14. --*/
  15. #include "precomp.h"
  16. IMPLEMENT_SHIM_BEGIN(IgnoreZeroMoveWindow)
  17. #include "ShimHookMacro.h"
  18. APIHOOK_ENUM_BEGIN
  19. APIHOOK_ENUM_ENTRY(MoveWindow)
  20. APIHOOK_ENUM_END
  21. /*++
  22. This function sanitizes 0 size windows by making them have a min height/width of 1.
  23. --*/
  24. BOOL
  25. APIHOOK(MoveWindow)(
  26. HWND hWnd, // handle to window
  27. int X, // horizontal position
  28. int Y, // vertical position
  29. int nWidth, // width
  30. int nHeight, // height
  31. BOOL bRepaint // repaint option
  32. )
  33. {
  34. if (0 == nWidth) nWidth=1;
  35. if (0 == nHeight) nHeight=1;
  36. return ORIGINAL_API(MoveWindow)(
  37. hWnd, X, Y, nWidth, nHeight, bRepaint);
  38. }
  39. /*++
  40. Register hooked functions
  41. --*/
  42. HOOK_BEGIN
  43. APIHOOK_ENTRY(USER32.DLL, MoveWindow)
  44. HOOK_END
  45. IMPLEMENT_SHIM_END