Windows 7 부터 지원되는 TaskBar progress bar



간단한 테스트 코드


// Windows Header Files: 

#include <windows.h> 

#include <windowsx.h> 

 

// Header Files for Windows 7 Taskbar features 

#include <shobjidl.h> 

#include <propkey.h> 

#include <propvarutil.h> 

#include <shlobj.h> 

#include <shellapi.h> 




HWND window_handle = f->GetHandle(); // 해당 윈도우 핸들


ITaskbarList3* taskbar_gauge = NULL;


    // 윈도우 버전 체크(Windows 7 is version 6.1).

DWORD dwMajor = LOBYTE(LOWORD(GetVersion()));

DWORD dwMinor = HIBYTE(LOWORD(GetVersion()));


// 생성

    if (dwMajor > 6 || (dwMajor == 6 && dwMinor > 0)) {

        HRESULT hr = CoCreateInstance(CLSID_TaskbarList, 

NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&taskbar_gauge));

if (!SUCCEEDED(hr)) {

return FALSE;

}

}


// clear the taskbar progress bar.

taskbar_gauge->SetProgressState(window_handle, TBPF_NOPROGRESS);


// status

taskbar_gauge->SetProgressState(window_handle, TBPF_NORMAL);

taskbar_gauge->SetProgressValue(window_handle, (ULONG)50, (ULONG)100);


// pause

taskbar_gauge->SetProgressState(window_handle, TBPF_PAUSED);

taskbar_gauge->SetProgressValue(window_handle, (ULONG)50, (ULONG)100);


// indeterminate

taskbar_gauge->SetProgressState(window_handle, TBPF_INDETERMINATE);


// error

taskbar_gauge->SetProgressState(window_handle, TBPF_ERROR);

taskbar_gauge->SetProgressValue(window_handle, (ULONG)50, (ULONG)100);


// 해제

taskbar_gauge->Release();




샘플 소스

Win7 taskbar progress bar (CppWin7TaskbarProgressBar)

Windows 7: How to display progress bar on taskbar icon?

Windows 7 Goodies in C++: Taskbar Progress and Status Indicators


Windows 7의 task bar

Exercise: Experiment with the New Windows 7 Taskbar Features







'C++' 카테고리의 다른 글

atlconv.h code page 관련  (0) 2012.07.04
shorcut 바로가기 아이콘 만들기  (0) 2012.06.30
c++ cookie 읽기  (0) 2012.06.26
7z LZMA sdk 윈도우 visual studio 컴파일  (0) 2012.06.26
WINDOWS-1251 로 인코딩 변환  (0) 2012.06.13
xml parser  (0) 2012.05.31
Google C++ Style Guide  (0) 2012.05.31
packet 구조 - network  (0) 2012.05.31