In the previous posts, I covered the basics of setting progress overlay and adding buttons to the thumbnail flyout area.
All thumbnail previews display the real-time content of the window client area. Suppose we're watching movies, we can see it through thumbnails. If we’re listening to music, we can see the album artwork on hovering the thumbnail. But we can customize the window area to display in the thumbnail area.
Let’s take the previous example. By default, Windows will display the entire window area.
Let’s take an example of clipping the preview to the scrollbar.
What we can do is quite simple and straightforward. Just set the offset from the client area to be clipped. See the example below. Setting a NULL
area will reset the thumbnail preview to default.
BEGIN_MESSAGE_MAP(CTaskBarSampleDlg, CDialogEx)
ON_REGISTERED_MESSAGE( g_uTBBC, CTaskBarSampleDlg::OnCreateThumbToolBar )
END_MESSAGE_MAP()
LRESULT CTaskBarSampleDlg::OnCreateThumbToolBar( WPARAM, LPARAM )
{
if( NULL == m_pTaskBarlist )
{
CoCreateInstance( CLSID_TaskbarList, NULL, CLSCTX_ALL,
IID_ITaskbarList3, (void**)&m_pTaskBarlist);
}
return 0;
}
void CTaskBarSampleDlg::OnBnClickedButton2()
{
static bool bClip = true;
if( bClip )
{
CRect rect;
m_Progress.GetWindowRect( rect );
ScreenToClient( rect );
m_pTaskBarlist->SetThumbnailClip( m_hWnd,rect );
}
else
m_pTaskBarlist->SetThumbnailClip
( m_hWnd, NULL );
bClip = !bClip;
}