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.

69 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. Pirch98.cpp
  5. Abstract:
  6. Remove the HWND_TOPMOST property on all their windows
  7. Notes:
  8. This is an app specific shim.
  9. History:
  10. 04/23/2001 robkenny Created
  11. --*/
  12. #include "precomp.h"
  13. IMPLEMENT_SHIM_BEGIN(Pirch98)
  14. #include "ShimHookMacro.h"
  15. APIHOOK_ENUM_BEGIN
  16. APIHOOK_ENUM_ENTRY(SetWindowPos)
  17. APIHOOK_ENUM_END
  18. /*++
  19. Remove the HWND_TOPMOST property on all their windows
  20. --*/
  21. BOOL
  22. APIHOOK(SetWindowPos)(
  23. HWND hWnd, // handle to window
  24. HWND hWndInsertAfter, // placement-order handle
  25. int X, // horizontal position
  26. int Y, // vertical position
  27. int cx, // width
  28. int cy, // height
  29. UINT uFlags // window-positioning options
  30. )
  31. {
  32. if (hWndInsertAfter == HWND_TOPMOST)
  33. {
  34. hWndInsertAfter = HWND_TOP;
  35. LOGN(eDbgLevelError, "[SetWindowPos] Replacing HWND_TOPMOST with HWND_TOP\n");
  36. }
  37. return ORIGINAL_API(SetWindowPos)(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags);
  38. }
  39. /*++
  40. Register hooked functions
  41. --*/
  42. HOOK_BEGIN
  43. APIHOOK_ENTRY(USER32.DLL, SetWindowPos)
  44. HOOK_END
  45. IMPLEMENT_SHIM_END