Hi everybody
Today I have another specific question about a new feature in windows 7 called the thumbnail toolbar or the Aero Peek Toolbar if some might like to call it that way. I have been able to create a new set of toolbar buttons for my application each button with its unique icon and behavior But I haven't been able to add functionality to the new buttons as the new THUMBUTTON structure does not specify any action parameter for a button object.
Here is a code snippet to show you what I've used to create the buttons:
ITaskbarList4* pitskbar;
HRESULT hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pitskbar));
HWND hwnd = AfxGetMainWnd()->GetSafeHwnd();
DWORD dwMask = THB_BITMAP | THB_FLAGS;
THUMBBUTTON thbButtons[3];
thbButtons[0].dwMask = (THUMBBUTTONMASK)dwMask;
thbButtons[0].iId = 0;
thbButtons[0].iBitmap = 0;
thbButtons[0].dwFlags = THBF_ENABLED;
thbButtons[1].dwMask = (THUMBBUTTONMASK)dwMask;
thbButtons[1].iId = 1;
.
.
<More Button Params>
.
.
CImageList m_imglst;
m_imglst.Create(16, 16, ILC_COLOR16, 0, 4);
HICON icon = (HICON)::LoadImage(theApp.m_hInstance, MAKEINTRESOURCE(IDI_ICON_ON), IMAGE_ICON, 16, 16, LR_SHARED);
m_imglst.Add(icon);
.
.
<More Images>
.
.
hr = pitskbar->ThumbBarSetImageList(hwnd, m_imglst);
if (SUCCEEDED(hr))
{
hr = pitskbar->ThumbBarAddButtons(hwnd, ARRAYSIZE(thbButtons), thbButtons);
}
pitskbar->Release();
I would appreciate any helpful answer as long as it is in the question's context.
Regards