Source code of Windows XP (NT5)
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.

53 lines
784 B

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. EmptyClipboardtoSet.cpp
  5. Abstract:
  6. Calendar of Ramadan V. 1 calls SetClipboardData with CF_TEXT without
  7. emptying the clipboard first.
  8. This shim is app specific
  9. History:
  10. 05/20/2001 mhamid created
  11. --*/
  12. #include "precomp.h"
  13. IMPLEMENT_SHIM_BEGIN(EmptyClipboardtoSet)
  14. #include "ShimHookMacro.h"
  15. APIHOOK_ENUM_BEGIN
  16. APIHOOK_ENUM_ENTRY(SetClipboardData)
  17. APIHOOK_ENUM_END
  18. HANDLE
  19. APIHOOK(SetClipboardData)(
  20. UINT uFormat,
  21. HANDLE hMem
  22. )
  23. {
  24. if (uFormat == CF_TEXT)
  25. EmptyClipboard();
  26. return ORIGINAL_API(SetClipboardData)(uFormat, hMem);
  27. }
  28. /*++
  29. Register hooked functions
  30. --*/
  31. HOOK_BEGIN
  32. APIHOOK_ENTRY(USER32.DLL, SetClipboardData)
  33. HOOK_END
  34. IMPLEMENT_SHIM_END