search

Home  >  Q&A  >  body text

c++ - win32 任务栏进度如何实现?

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

高洛峰高洛峰2807 days ago719

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 13:39:53

    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

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:39:53

    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;

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:39:53

    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.

    reply
    0
  • Cancelreply