ResizableGrip.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // ResizableGrip.h: interface for the CResizableGrip class.
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright (C) 2000-2001 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. #if !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)
  17. #define AFX_RESIZABLEGRIP_H__INCLUDED_
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif // _MSC_VER > 1000
  21. #define WS_EX_LAYOUT_RTL 0x00400000
  22. class CResizableGrip
  23. {
  24. private:
  25. SIZE m_sizeGrip; // holds grip size
  26. CScrollBar m_wndGrip; // grip control
  27. private:
  28. static BOOL IsRTL(HWND hwnd)
  29. {
  30. DWORD dwExStyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
  31. return (dwExStyle & WS_EX_LAYOUT_RTL);
  32. }
  33. static LRESULT CALLBACK GripWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  34. protected:
  35. BOOL InitGrip();
  36. void UpdateGripPos();
  37. void ShowSizeGrip(BOOL bShow = TRUE); // show or hide the size grip
  38. virtual CWnd* GetResizableWnd() = 0;
  39. public:
  40. CResizableGrip();
  41. virtual ~CResizableGrip();
  42. };
  43. #endif // !defined(AFX_RESIZABLEGRIP_H__INCLUDED_)