ResizableMsgSupport.inl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // ResizableMsgSupport.inl: some definitions to support custom resizable wnds
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright (C) 2000-2002 by Paolo Messina
  6. // (http://www.geocities.com/ppescher - ppescher@yahoo.com)
  7. //
  8. // The contents of this file are subject to the Artistic License (the "License").
  9. // You may not use this file except in compliance with the License.
  10. // You may obtain a copy of the License at:
  11. // http://www.opensource.org/licenses/artistic-license.html
  12. //
  13. // If you find this code useful, credits would be nice!
  14. //
  15. /////////////////////////////////////////////////////////////////////////////
  16. // registered message to communicate with the library
  17. // (defined so that in the same executable it is initialized only once)
  18. const UINT WMU_RESIZESUPPORT = ::RegisterWindowMessage(_T("WMU_RESIZESUPPORT"));
  19. // if the message is implemented the returned value must be non-zero
  20. // the default window procedure returns zero for unhandled messages
  21. // wParam is one of the following RSZSUP_* values, lParam as specified
  22. #define RSZSUP_QUERYPROPERTIES 101 // lParam = LPRESIZEPROPERTIES
  23. #define RSZSUP_LIKESCLIPPING 102 // lParam = LPCLIPPINGPROPERTY
  24. #define RSZSUP_NEEDSREFRESH 103 // lParam = LPREFRESHPROPERTY
  25. /////////////////////////////////////////////////////////////////////////////
  26. // utility functions
  27. inline BOOL Send_QueryProperties(HWND hWnd, LPRESIZEPROPERTIES pResizeProperties)
  28. {
  29. ASSERT(::IsWindow(hWnd));
  30. return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
  31. RSZSUP_QUERYPROPERTIES, (LPARAM)pResizeProperties));
  32. }
  33. inline BOOL Send_LikesClipping(HWND hWnd, LPCLIPPINGPROPERTY pClippingProperty)
  34. {
  35. ASSERT(::IsWindow(hWnd));
  36. return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
  37. RSZSUP_LIKESCLIPPING, (LPARAM)pClippingProperty));
  38. }
  39. inline BOOL Send_NeedsRefresh(HWND hWnd, LPREFRESHPROPERTY pRefreshProperty)
  40. {
  41. ASSERT(::IsWindow(hWnd));
  42. return (0 != SendMessage(hWnd, WMU_RESIZESUPPORT,
  43. RSZSUP_NEEDSREFRESH, (LPARAM)pRefreshProperty));
  44. }