c++ - win32 任务栏进度如何实现?
高洛峰
高洛峰 2017-04-17 13:37:53
0
3
688

类似迅雷这种。任务栏上面会显示 下载的进度。
还有鼠标放上去会显示自定义控件是怎么做的?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(3)
Ty80
  1. SetProgressValue Method
    http://msdn.microsoft.com/en-us/library/dd391698(VS.85).aspx

  2. SetProgressState Method
    http://msdn.microsoft.com/en-us/library/dd391697(VS.85).aspx

洪涛

In MFC:

  1. MSDN - ITaskbarList3 Interface

  2. Initialize COM interface

    CoCreateInstance( CLSID_TaskbarList, nullptr, CLSCTX_ALL, __uuidof(ITaskbarList3), (LPVOID*)&m_pTL3 );

  3. Registration message

    static const UINT WM_TBC = RegisterWindowMessage(TEXT("TaskbarButtonCreated"));

  4. Show status

    m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_ERROR);
    m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_PAUSE);
    m_pTL3->SetProgressState(GetSafeHwnd(), TBPF_NORMAL);

  5. Show progress

    m_pTL3->SetProgressValue(GetSafeHwnd(), 50, 100);

  6. 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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template