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.

93 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. HPTourGuide.cpp
  5. Abstract:
  6. The application causes Explorer to crash when
  7. a tour is selected. To fix we are eating LVM_GETITEMA
  8. messages if the window handle matches the ListView
  9. that the app was sending to.
  10. Fix for Whistler bug #177103
  11. Notes:
  12. This is an app specific shim.
  13. History:
  14. 03/28/2001 robdoyle Created
  15. --*/
  16. #include "precomp.h"
  17. IMPLEMENT_SHIM_BEGIN(HPTourGuide)
  18. #include "ShimHookMacro.h"
  19. APIHOOK_ENUM_BEGIN
  20. APIHOOK_ENUM_ENTRY(SendMessageA)
  21. APIHOOK_ENUM_END
  22. /*++
  23. Eat LVM_GETITEMA messages for a specific hWnd
  24. --*/
  25. BOOL
  26. APIHOOK(SendMessageA)(
  27. HWND hWnd,
  28. UINT uMsg,
  29. WPARAM wParam,
  30. LPARAM lParam
  31. )
  32. {
  33. LRESULT lRet;
  34. HWND hWnd_TARGET, hWnd_temp;
  35. hWnd_temp = FindWindowExA (NULL, NULL, "Progman", "Program Manager");
  36. hWnd_temp = FindWindowExA (hWnd_temp, NULL, "SHELLDLL_DefView", NULL);
  37. hWnd_TARGET = FindWindowExA (hWnd_temp, NULL, "SysListView32", NULL);
  38. if ((hWnd == hWnd_TARGET) && (uMsg == LVM_GETITEMA))
  39. {
  40. /* Uncomment to aid debugging
  41. DPFN( eDbgLevelError, "bypassing SendMessage of LVM_GETITEMA");
  42. */
  43. lRet = TRUE;
  44. }
  45. else
  46. {
  47. lRet = ORIGINAL_API(SendMessageA)(
  48. hWnd,
  49. uMsg,
  50. wParam,
  51. lParam);
  52. }
  53. return lRet;
  54. }
  55. /*++
  56. Register hooked functions
  57. --*/
  58. HOOK_BEGIN
  59. APIHOOK_ENTRY(USER32.DLL, SendMessageA)
  60. HOOK_END
  61. IMPLEMENT_SHIM_END