类似迅雷这种。任务栏上面会显示 下载的进度。还有鼠标放上去会显示自定义控件是怎么做的?
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
SetProgressValue Method http://msdn.microsoft.com/en-us/library/dd391698(VS.85).aspx
SetProgressState Method http://msdn.microsoft.com/en-us/library/dd391697(VS.85).aspx
In MFC:
MSDN - ITaskbarList3 Interface
Initialize COM interface
CoCreateInstance( CLSID_TaskbarList, nullptr, CLSCTX_ALL, __uuidof(ITaskbarList3), (LPVOID*)&m_pTL3 );
Registration message
static const UINT WM_TBC = RegisterWindowMessage(TEXT("TaskbarButtonCreated"));
Show status
m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_ERROR); m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_PAUSE); m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_NORMAL);
Show progress
m_pTL3->SetProgressValue(GetSafeHwnd(), 50, 100);
Release
m_pTL3->Release(); m_pTL3 = nullptr;
This can be achieved using QWinExtra. pro file added: QT += winextra. Refer to the four classes QWinTaskbarButton, QWinTaskbarProgress, QWinThumbnailToolBar, and QWinThumbnailToolButton. You can refer to winextra/music player in Qt Examples.
SetProgressValue Method
http://msdn.microsoft.com/en-us/library/dd391698(VS.85).aspx
SetProgressState Method
http://msdn.microsoft.com/en-us/library/dd391697(VS.85).aspx
In MFC:
MSDN - ITaskbarList3 Interface
Initialize COM interface
CoCreateInstance( CLSID_TaskbarList, nullptr, CLSCTX_ALL, __uuidof(ITaskbarList3), (LPVOID*)&m_pTL3 );
Registration message
static const UINT WM_TBC = RegisterWindowMessage(TEXT("TaskbarButtonCreated"));
Show status
m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_ERROR);
m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_PAUSE);
m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_NORMAL);
Show progress
m_pTL3->SetProgressValue(GetSafeHwnd(), 50, 100);
Release
m_pTL3->Release();
m_pTL3 = nullptr;
This can be achieved using QWinExtra.
pro file added: QT += winextra.
Refer to the four classes QWinTaskbarButton, QWinTaskbarProgress, QWinThumbnailToolBar, and QWinThumbnailToolButton.
You can refer to winextra/music player in Qt Examples.