Bitmap in headcontrol does not work fine in Windows XP style
-
Hi all: I have a program using a listctrl to display information from database which can sort the data by left click the headcontrol and then an image represent the sort state will be displayed. Everything works fine except running in Windows XP style. When I drag the column head with sort state image on it, the drag image become a whole black thing with nothing on it instead of the normal drag image with some transparency. This happens only for columns which have the sort state image on. I use the following steps to set the sort image on the headcontrol:
CBitmap *pTempBmp = NULL; if( bAsc ) pTempBmp = &m_bmpArrowUp; // m_bmpArrowUp is a pre-loaded bitmap object else pTempBmp = &m_bmpArrowDown;// m_bmpArrowDown is a pre-loaded bitmap object HD_ITEM Item; Item.mask = HDI_FORMAT; GetItem( nCol, &Item ); Item.mask = HDI_BITMAP | HDI_FORMAT; Item.fmt |= HDF_BITMAP; Item.hbm = (HBITMAP)pTempBmp->GetSafeHandle(); SetItem( nCol, &Item );
So can anybody help me to solve this tiny problem?Lisoft