API for change the visibility of button in the taskbar.

- ShowInTaskbar and HideInTaskbar
- Sample of usage.

Author: Chaobin Zhang

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Chaobin, Zhang
2014-09-10 08:40:39 +00:00
parent 1fa04989f3
commit 3de2241fa7
4 changed files with 41 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////
// Name: src/msw/taskbarbutton.cpp
// Purpose: Implements wxTaskbarButtonImpl class for manipulating buttons on
// Purpose: Implements wxTaskBarButtonImpl class for manipulating buttons on
// the Windows taskbar.
// Author: Chaobin Zhang <zhchbin@gmail.com>
// Created: 2014-06-01
@@ -22,7 +22,8 @@
#include <Shobjidl.h>
wxTaskBarButtonImpl::wxTaskBarButtonImpl(WXWidget parent) : m_hwnd(parent)
wxTaskBarButtonImpl::wxTaskBarButtonImpl(WXWidget parent)
: m_hwnd(parent), m_taskbarList(NULL)
{
HRESULT hr = CoCreateInstance
(
@@ -60,4 +61,14 @@ void wxTaskBarButtonImpl::SetProgressValue(int value)
m_taskbarList->SetProgressValue(m_hwnd, value, 100);
}
void wxTaskBarButtonImpl::ShowInTaskbar()
{
m_taskbarList->AddTab(m_hwnd);
}
void wxTaskBarButtonImpl::HideInTaskbar()
{
m_taskbarList->DeleteTab(m_hwnd);
}
#endif // wxUSE_TASKBARBUTTON