Index: src/ch/StatusDlg.cpp =================================================================== diff -u -red1beefb06bbe87cf779b6a97db502fea5f2e109 -rd04caed42cbc16ffd508f173ca5f92d9512cfc69 --- src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision ed1beefb06bbe87cf779b6a97db502fea5f2e109) +++ src/ch/StatusDlg.cpp (.../StatusDlg.cpp) (revision d04caed42cbc16ffd508f173ca5f92d9512cfc69) @@ -712,6 +712,9 @@ // apply state of the resume, cancel, ... buttons ApplyButtonsState(); + + // update taskbar progress + UpdateTaskBarProgress(); } void CStatusDlg::OnSelectionChanged(NMHDR* /*pNMHDR*/, LRESULT* /*pResult*/) @@ -1247,3 +1250,16 @@ return strTitleText; } + +void CStatusDlg::UpdateTaskBarProgress() const +{ + if(m_spTaskMgrStats->GetRunningTasks() != 0) + { + unsigned long long ullProgress = (unsigned long long)(m_spTaskMgrStats->GetCombinedProgress() * 100.0); + + m_taskBarProgress.SetState(m_hWnd, TBPF_NORMAL); + m_taskBarProgress.SetPosition(m_hWnd, ullProgress, 100); + } + else + m_taskBarProgress.SetState(m_hWnd, TBPF_NOPROGRESS); +} Index: src/ch/StatusDlg.h =================================================================== diff -u -r3bc596c5916dddf4016d9cb8693c3450c86041a8 -rd04caed42cbc16ffd508f173ca5f92d9512cfc69 --- src/ch/StatusDlg.h (.../StatusDlg.h) (revision 3bc596c5916dddf4016d9cb8693c3450c86041a8) +++ src/ch/StatusDlg.h (.../StatusDlg.h) (revision d04caed42cbc16ffd508f173ca5f92d9512cfc69) @@ -21,6 +21,7 @@ #include "FFListCtrl.h" #include "TProgressCtrlEx.h" +#include "TExplorerTaskBarProgress.h" namespace chcore { @@ -74,6 +75,8 @@ CString GetSubtaskName(chcore::ESubOperationType eSubtask) const; CString GetProgressWindowTitleText() const; + void UpdateTaskBarProgress() const; + CString GetSpeedString(double dSizeSpeed, double dAvgSizeSpeed, double dCountSpeed, double dAvgCountSpeed) const; void SetWindowTitle(PCTSTR pszText); @@ -122,6 +125,7 @@ TProgressCtrlEx m_ctlProgressAll; chcore::TTaskManagerStatsSnapshotPtr m_spTaskMgrStats; + TExplorerTaskBarProgress m_taskBarProgress; }; #endif Index: src/ch/TExplorerTaskBarProgress.cpp =================================================================== diff -u --- src/ch/TExplorerTaskBarProgress.cpp (revision 0) +++ src/ch/TExplorerTaskBarProgress.cpp (revision d04caed42cbc16ffd508f173ca5f92d9512cfc69) @@ -0,0 +1,48 @@ +// ============================================================================ +// Copyright (C) 2001-2016 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#include "stdafx.h" +#include "TExplorerTaskBarProgress.h" + +TExplorerTaskBarProgress::TExplorerTaskBarProgress() +{ + HRESULT hResult = CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (void**)&m_piTaskBarList3); + if(FAILED(hResult) && m_piTaskBarList3) + m_piTaskBarList3 = nullptr; +} + +TExplorerTaskBarProgress::~TExplorerTaskBarProgress() +{ + if(m_piTaskBarList3) + { + m_piTaskBarList3->Release(); + m_piTaskBarList3 = nullptr; + } +} + +void TExplorerTaskBarProgress::SetState(HWND hwnd, TBPFLAG flag) const +{ + if(m_piTaskBarList3) + m_piTaskBarList3->SetProgressState(hwnd, flag); +} + +void TExplorerTaskBarProgress::SetPosition(HWND hwnd, unsigned long long ullCompleted, unsigned long long ullTotal) const +{ + if(m_piTaskBarList3) + m_piTaskBarList3->SetProgressValue(hwnd, ullCompleted, ullTotal); +} Index: src/ch/TExplorerTaskBarProgress.h =================================================================== diff -u --- src/ch/TExplorerTaskBarProgress.h (revision 0) +++ src/ch/TExplorerTaskBarProgress.h (revision d04caed42cbc16ffd508f173ca5f92d9512cfc69) @@ -0,0 +1,37 @@ +// ============================================================================ +// Copyright (C) 2001-2016 by Jozef Starosczyk +// ixen@copyhandler.com +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU Library General Public License +// (version 2) as published by the Free Software Foundation; +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU Library General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., +// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// ============================================================================ +#ifndef __TEXPLORERTASKBARPROGRESS_H__ +#define __TEXPLORERTASKBARPROGRESS_H__ + +interface ITaskbarList3; + +class TExplorerTaskBarProgress +{ +public: + TExplorerTaskBarProgress(); + ~TExplorerTaskBarProgress(); + + void SetState(HWND hwnd, TBPFLAG flag) const; + void SetPosition(HWND hwnd, unsigned long long ullCompleted, unsigned long long ullTotal) const; + +private: + ITaskbarList3* m_piTaskBarList3 = nullptr; +}; + +#endif Index: src/ch/ch.vc140.vcxproj =================================================================== diff -u -r09cedb80782a75d4b4896a1f3d2dd535688bf840 -rd04caed42cbc16ffd508f173ca5f92d9512cfc69 --- src/ch/ch.vc140.vcxproj (.../ch.vc140.vcxproj) (revision 09cedb80782a75d4b4896a1f3d2dd535688bf840) +++ src/ch/ch.vc140.vcxproj (.../ch.vc140.vcxproj) (revision d04caed42cbc16ffd508f173ca5f92d9512cfc69) @@ -533,6 +533,7 @@ + @@ -785,6 +786,7 @@ + Index: src/ch/ch.vc140.vcxproj.filters =================================================================== diff -u -r09cedb80782a75d4b4896a1f3d2dd535688bf840 -rd04caed42cbc16ffd508f173ca5f92d9512cfc69 --- src/ch/ch.vc140.vcxproj.filters (.../ch.vc140.vcxproj.filters) (revision 09cedb80782a75d4b4896a1f3d2dd535688bf840) +++ src/ch/ch.vc140.vcxproj.filters (.../ch.vc140.vcxproj.filters) (revision d04caed42cbc16ffd508f173ca5f92d9512cfc69) @@ -251,6 +251,9 @@ Source Files\Tools + + Source Files\Tools + @@ -430,6 +433,9 @@ Source Files\Tools + + Source Files\Tools +