I want to set the background image of a ListView control in my Shell Extension. The ListView inherits IShellView and I am using the following code:-
HBITMAP m_hBmp = (HBITMAP)::LoadImage( hinst,
MAKEINTRESOURCE( IDB_BITMAP1 ), IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION | LR_LOADMAP3DCOLORS);
if ( m_hBmp )
{
LVBKIMAGE bki;
bki.ulFlags= LVBKIF_SOURCE_HBITMAP;
bki.hbm = m_hBmp;
bki.cchImageMax = sizeof( bki.hbm );
bki.xOffsetPercent = 50;
bki.yOffsetPercent = 50;
ListView_SetBkImage(m_hwndList,&bki);
}
The above code works fine in Vista but for some reason it does not work in XP. Is there anything that I am missing?