This documentation is archived and is not being maintained.


Sets the image list that the current toolbar control uses to represent buttons in the pressed state.

CImagelist* SetPressedImageList(
            int iImageID, 
            CImageList* pImageList



[in] iImageID

The zero-based index of the image list. Set this parameter to zero if you use only one image list.

[in] pImageList

Pointer to a CImageList that contains the new image list.

Pointer to a CImageList that contains the previous image list for the current control, or NULL if no such image list was set.

This method sends the TB_SETPRESSEDIMAGELIST message, which is described in the Windows SDK.

Header: afxcmn.h

This control is supported in Windows Vista and later.

Additional requirements for this method are described in Build Requirements for Windows Vista Common Controls.

The following code example sets the pressed image list to be the same as the default image list.

		// SetPressedImageList 
		// Set the pressed image list to be the same as the  
		// normal image list.
		CToolBarCtrl& m_toolBarCtrl = m_wndToolBar.GetToolBarCtrl();
		CImageList* pNormalCil =  m_toolBarCtrl.GetImageList();
		CImageList* pPressedCil = m_toolBarCtrl.GetPressedImageList();
		m_toolBarCtrl.SetPressedImageList( 0, pNormalCil );