winctrl7.cpp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #include "stdafx.h"
  11. #ifdef AFX_CMNCTL_SEG
  12. #pragma code_seg(AFX_CMNCTL_SEG)
  13. #endif
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. #define new DEBUG_NEW
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CImageList
  21. BOOL CImageList::DrawIndirect(IMAGELISTDRAWPARAMS* pimldp)
  22. {
  23. ASSERT(m_hImageList != NULL);
  24. ASSERT_POINTER(pimldp, IMAGELISTDRAWPARAMS);
  25. pimldp->cbSize = sizeof(IMAGELISTDRAWPARAMS);
  26. pimldp->himl = m_hImageList;
  27. return ImageList_DrawIndirect(pimldp);
  28. }
  29. BOOL CImageList::DrawIndirect(CDC* pDC, int nImage, POINT pt,
  30. SIZE sz, POINT ptOrigin, UINT fStyle /* = ILD_NORMAL */,
  31. DWORD dwRop /* = SRCCOPY */, COLORREF rgbBack /* = CLR_DEFAULT */,
  32. COLORREF rgbFore /* = CLR_DEFAULT */)
  33. {
  34. ASSERT_POINTER(pDC, CDC);
  35. ASSERT(pDC->m_hDC != NULL);
  36. IMAGELISTDRAWPARAMS drawing;
  37. drawing.i = nImage;
  38. drawing.hdcDst = pDC->m_hDC;
  39. drawing.x = pt.x;
  40. drawing.y = pt.y;
  41. drawing.cx = sz.cx;
  42. drawing.cy = sz.cy;
  43. drawing.xBitmap = ptOrigin.x;
  44. drawing.yBitmap = ptOrigin.y;
  45. drawing.rgbBk = rgbBack;
  46. drawing.rgbFg = rgbFore;
  47. drawing.fStyle = fStyle;
  48. drawing.dwRop = dwRop;
  49. // this call initializes cbSize and himl;
  50. return DrawIndirect(&drawing);
  51. }
  52. BOOL CImageList::Create(CImageList* pImageList)
  53. {
  54. ASSERT(pImageList != NULL);
  55. return Attach(ImageList_Duplicate(pImageList->m_hImageList));
  56. }
  57. /////////////////////////////////////////////////////////////////////////////