diff --git a/include/wx/msw/taskbarbutton.h b/include/wx/msw/taskbarbutton.h index 537f2f361d..04a368281e 100644 --- a/include/wx/msw/taskbarbutton.h +++ b/include/wx/msw/taskbarbutton.h @@ -69,7 +69,7 @@ private: class WXDLLIMPEXP_CORE wxTaskBarJumpListImpl { public: - wxTaskBarJumpListImpl(); + wxTaskBarJumpListImpl(const wxString& appID = wxEmptyString); virtual ~wxTaskBarJumpListImpl(); void ShowRecentCategory(bool shown = true); void HideRecentCategory(); @@ -102,6 +102,9 @@ private: wxTaskBarJumpListCategories m_customCategories; bool m_recent_visible; bool m_frequent_visible; + + // Application User Model ID. + wxString m_appID; }; #endif // wxUSE_TASKBARBUTTON diff --git a/include/wx/taskbarbutton.h b/include/wx/taskbarbutton.h index c513bdc8dc..c6fa6a23ee 100644 --- a/include/wx/taskbarbutton.h +++ b/include/wx/taskbarbutton.h @@ -212,7 +212,7 @@ typedef wxVector wxTaskBarJumpListCategories; class WXDLLIMPEXP_CORE wxTaskBarJumpList { public: - wxTaskBarJumpList(); + wxTaskBarJumpList(const wxString& appID = wxEmptyString); virtual ~wxTaskBarJumpList(); void ShowRecentCategory(bool shown = true); void HideRecentCategory(); diff --git a/src/msw/taskbarbutton.cpp b/src/msw/taskbarbutton.cpp index 89effdb1a6..3c3ee5b235 100644 --- a/src/msw/taskbarbutton.cpp +++ b/src/msw/taskbarbutton.cpp @@ -1077,8 +1077,8 @@ const wxTaskBarJumpListItems& wxTaskBarJumpListCategory::GetItems() const // ---------------------------------------------------------------------------- // wxTaskBarJumpList Implementation. // ---------------------------------------------------------------------------- -wxTaskBarJumpList::wxTaskBarJumpList() - : m_jumpListImpl(new wxTaskBarJumpListImpl()) +wxTaskBarJumpList::wxTaskBarJumpList(const wxString& appID) + : m_jumpListImpl(new wxTaskBarJumpListImpl(appID)) { } @@ -1152,7 +1152,9 @@ void wxTaskBarJumpList::Update() // ---------------------------------------------------------------------------- // wxTaskBarJumpListImpl Implementation. // ---------------------------------------------------------------------------- -wxTaskBarJumpListImpl::wxTaskBarJumpListImpl() : m_destinationList(NULL) +wxTaskBarJumpListImpl::wxTaskBarJumpListImpl(const wxString& appID) + : m_appID(appID), + m_destinationList(NULL) { HRESULT hr = CoCreateInstance ( @@ -1289,6 +1291,8 @@ bool wxTaskBarJumpListImpl::BeginUpdate() unsigned int max_count = 0; HRESULT hr = m_destinationList->BeginList(&max_count, wxIID_IObjectArray, reinterpret_cast(&(m_objectArray))); + if ( !m_appID.empty() ) + m_destinationList->SetAppID(m_appID.wc_str()); return SUCCEEDED(hr); } @@ -1364,6 +1368,8 @@ void wxTaskBarJumpListImpl::LoadKnownCategory(const wxString& title) wxLogApiError("CoCreateInstance(wxCLSID_ApplicationDocumentLists)", hr); return; } + if ( !m_appID.empty() ) + docList->SetAppID(m_appID.wc_str()); IObjectArray *array = NULL; wxASSERT_MSG( title == "Recent" || title == "Frequent", "Invalid title." );