if((m_dwSortLVExtendedStyle & SORTLV_USESHELLBITMAPS) != 0) { bool bFree = false; LPCTSTR pszModule = _T("shell32.dll"); HINSTANCE hShell = ::GetModuleHandle(pszModule);  if (hShell == NULL) { hShell = ::LoadLibrary(pszModule); bFree = true; }  if (hShell != NULL) { bool bSuccess = true; for(int i = m_iSortUp; i <= m_iSortDown; i++) { if(!m_bmSort[i].IsNull()) m_bmSort[i].DeleteObject(); m_bmSort[i] = (HBITMAP)::LoadImage(hShell, MAKEINTRESOURCE(m_nShellSortUpID + i), IMAGE_BITMAP, 0, 0, LR_LOADMAP3DCOLORS); if(m_bmSort[i].IsNull()) { bSuccess = false; break; } } if(bFree) ::FreeLibrary(hShell); if(bSuccess) return; } }
	void CreateSortBitmaps()	{		T* pT = static_cast<T*>(this);		for(int i = m_iSortUp; i <= m_iSortDown; i++)		{			if(!m_bmSort[i].IsNull())				m_bmSort[i].DeleteObject();			CDC dcMem;			CClientDC dc(::GetDesktopWindow());			dcMem.CreateCompatibleDC(dc.m_hDC);			m_bmSort[i].CreateCompatibleBitmap(dc.m_hDC, m_cxSortImage, m_cySortImage);			HBITMAP hbmOld = dcMem.SelectBitmap(m_bmSort[i]);			RECT rc = {0,0,m_cxSortImage, m_cySortImage};			pT->DrawSortBitmap(dcMem.m_hDC, i, &rc);			dcMem.SelectBitmap(hbmOld);			dcMem.DeleteDC();		}	}