/** * @file XTPTaskbarManager.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPTASKBARMANAGER_H__) # define __XTPTASKBARMANAGER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" interface ITaskbarList3; interface ICustomDestinationList; interface IObjectArray; interface IShellItem; interface IShellLinkW; enum XTPTaskbarProgressFlag { xtpProgressFlagNoProgress = 0, xtpProgressFlagIndeterminate = 0x1, xtpProgressFlagNormal = 0x2, xtpProgressFlagError = 0x4, xtpProgressFlagPaused = 0x8 }; class _XTP_EXT_CLASS CXTPTaskbarManagerJumpList : public CXTPCmdTarget { protected: struct CTask { CString m_strPath; CString m_strArguments; CString m_strTitle; CString m_strIconPath; CString m_strWorkingDir; int m_nIconIndex; }; protected: CXTPTaskbarManagerJumpList(); ~CXTPTaskbarManagerJumpList(); public: void AddTask(LPCTSTR lpszPath, LPCTSTR lpszArgument, LPCTSTR lpszTitle, LPCTSTR lpszIconPath, int nIconIndex = -1); void AddTask(LPCTSTR lpszPath, LPCTSTR lpszArgument, LPCTSTR lpszTitle, LPCTSTR lpszIconPath, LPCTSTR lpszWorkingDir, int nIconIndex = -1); void Clear(); void CommitList(); void SetAppID(LPCWSTR lpszAppID); void AppendKnownCategory(UINT uiCategory); private: void DeleteList(); void BuildList(); private: HRESULT AddUserTasks(); HRESULT AddCustomCategory(); void AddTaskImpl(LPCTSTR lpszPath, LPCTSTR lpszArgument, LPCTSTR lpszTitle, LPCTSTR lpszIconPath, LPCTSTR lpszWorkingDir, int nIconIndex); HRESULT CreateShellLink(LPCWSTR lpszApp, LPCWSTR lpszCommandLine, LPCWSTR lpszTitle, LPCWSTR lpszIconPath, LPCWSTR lpszWorkingDir, int nIconIndex, IShellLinkW** ppSL); BOOL IsItemInArray(IShellItem* pSI, IObjectArray* pArray); private: ICustomDestinationList* m_pcdl; IObjectArray* m_poaRemoved; CString m_sAppID; UINT m_uiCategory; friend class CXTPTaskbarManager; CArray m_arrTask; # ifdef _XTP_ACTIVEX /** @cond */ public: DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPTaskbarManagerJumpList); void OleAddTask(LPCTSTR lpszPath, LPCTSTR lpszArgument, LPCTSTR lpszTitle, LPCTSTR lpszIconPath, int nIconIndex = -1); void OleAddTaskEx(LPCTSTR lpszPath, LPCTSTR lpszArgument, LPCTSTR lpszTitle, LPCTSTR lpszIconPath, LPCTSTR lpszWorkingDir, int nIconIndex = -1); /** @endcond */ # endif }; /** @cond */ AFX_INLINE void CXTPTaskbarManagerJumpList::SetAppID(LPCWSTR lpszAppID) { m_sAppID = lpszAppID; } AFX_INLINE void CXTPTaskbarManagerJumpList::AppendKnownCategory(UINT uiCategory) { m_uiCategory = uiCategory; } /** @endcond */ class _XTP_EXT_CLASS CXTPTaskbarManager { // Constructor public: CXTPTaskbarManager(); virtual ~CXTPTaskbarManager(); public: void SetProgressBarRange(HWND hWndParent, int nRangeMin, int nRangeMax); void SetProgressBarPosition(HWND hWndParent, int nProgressPos); void SetProgressBarState(HWND hWndParent, int nFlags); BOOL SetOverlayIcon(HWND hWndParent, HICON hIcon, LPCTSTR lpszDescription); BOOL SetOverlayIcon(HWND hWndParent, UINT nIDResource, LPCTSTR lpszDescription); public: CXTPTaskbarManagerJumpList* GetJumpList() const; // Implementation protected: int m_nProgressBarRangeMax; int m_nProgressBarRangeMin; ITaskbarList3* m_pTaskbarList3; CXTPTaskbarManagerJumpList* m_pJumpList; }; /** @cond */ AFX_INLINE CXTPTaskbarManagerJumpList* CXTPTaskbarManager::GetJumpList() const { return m_pJumpList; } /** @endcond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // #if !defined(__XTPTASKBARMANAGER_H__) /** @endcond */