summaryrefslogtreecommitdiff
path: root/vcl/win/window
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2024-04-27 14:23:12 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-07-17 21:05:15 +0200
commit0c6642ed3a2dbcd54456f61706606fa3371b70ba (patch)
tree398c709fa556dac7c8e321abbfaa2f87f5129ee2 /vcl/win/window
parenta7327e95cee60d59bdec1b62e144179efa9f2eb8 (diff)
vcl: support for Windows ITaskbarList3 interface
And a demo implementation for these features as a taskbar window will become red once LO is displaying any error message. Change-Id: Ifc04026c699059da2e457de2c69e7363e756109c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166740 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'vcl/win/window')
-rw-r--r--vcl/win/window/salframe.cxx53
1 files changed, 53 insertions, 0 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 1661d3408fa8..1cf551c00d78 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -903,6 +903,7 @@ WinSalFrame::WinSalFrame()
mpNextClipRect = nullptr;
mnDisplay = 0;
mbPropertiesStored = false;
+ m_pTaskbarList3 = nullptr;
// get data, when making 1st frame
if ( !pSalData->mpFirstFrame )
@@ -985,6 +986,11 @@ WinSalFrame::~WinSalFrame()
mpLocalGraphics = nullptr;
}
+ if ( m_pTaskbarList3 )
+ {
+ m_pTaskbarList3->Release();
+ }
+
if ( mhWnd )
{
// reset mouse leave data
@@ -3159,6 +3165,53 @@ bool WinSalFrame::GetUseReducedAnimation() const
return !bEnableAnimation;
}
+void WinSalFrame::SetTaskBarProgress(int nCurrentProgress)
+{
+ if (!m_pTaskbarList3)
+ {
+ HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (void **)&m_pTaskbarList3);
+ if (!SUCCEEDED(hr) || !m_pTaskbarList3)
+ return;
+ }
+
+ m_pTaskbarList3->SetProgressValue(mhWnd, nCurrentProgress, 100);
+}
+
+void WinSalFrame::SetTaskBarState(VclTaskBarStates eTaskBarState)
+{
+ if (!m_pTaskbarList3)
+ {
+ HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (void **)&m_pTaskbarList3);
+ if (!SUCCEEDED(hr) || !m_pTaskbarList3)
+ return;
+ }
+
+ TBPFLAG nFlag;
+ switch (eTaskBarState)
+ {
+ case VclTaskBarStates::Progress:
+ nFlag = TBPF_NORMAL;
+ break;
+ case VclTaskBarStates::ProgressUnknown:
+ nFlag = TBPF_INDETERMINATE;
+ break;
+ case VclTaskBarStates::Paused:
+ nFlag = TBPF_PAUSED;
+ SetTaskBarProgress(100);
+ break;
+ case VclTaskBarStates::Error:
+ nFlag = TBPF_ERROR;
+ SetTaskBarProgress(100);
+ break;
+ case VclTaskBarStates::Normal:
+ default:
+ nFlag = TBPF_NOPROGRESS;
+ break;
+ }
+
+ m_pTaskbarList3->SetProgressState(mhWnd, nFlag);
+}
+
static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam )
{