Readding the taskbar progress display.
This commit is contained in:
@@ -92,8 +92,7 @@ INT_PTR CALLBACK LoadingWindow_Win32::DlgProc( HWND hWnd, UINT msg, WPARAM wPara
|
|||||||
self=(LoadingWindow_Win32 *)GetWindowLong(hWnd,DWL_USER);
|
self=(LoadingWindow_Win32 *)GetWindowLong(hWnd,DWL_USER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
#if WINVER >= 0x0601
|
|
||||||
if (self && msg == self->taskbarCreatedEvent && !self->pTaskbarList) {
|
if (self && msg == self->taskbarCreatedEvent && !self->pTaskbarList) {
|
||||||
HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&self->pTaskbarList));
|
HRESULT hr = CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&self->pTaskbarList));
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
@@ -116,7 +115,6 @@ INT_PTR CALLBACK LoadingWindow_Win32::DlgProc( HWND hWnd, UINT msg, WPARAM wPara
|
|||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
switch( msg )
|
switch( msg )
|
||||||
{
|
{
|
||||||
@@ -144,14 +142,12 @@ INT_PTR CALLBACK LoadingWindow_Win32::DlgProc( HWND hWnd, UINT msg, WPARAM wPara
|
|||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
|
|
||||||
/*
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
#if(WINVER >= 0x0601)
|
|
||||||
if (self->pTaskbarList) {
|
if (self->pTaskbarList) {
|
||||||
self->pTaskbarList->Release();
|
self->pTaskbarList->Release();
|
||||||
self->pTaskbarList = NULL;
|
self->pTaskbarList = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
DeleteObject( g_hBitmap );
|
DeleteObject( g_hBitmap );
|
||||||
g_hBitmap = NULL;
|
g_hBitmap = NULL;
|
||||||
@@ -209,13 +205,11 @@ LoadingWindow_Win32::LoadingWindow_Win32()
|
|||||||
cceData.dwICC=ICC_PROGRESS_CLASS;
|
cceData.dwICC=ICC_PROGRESS_CLASS;
|
||||||
InitCommonControlsEx(&cceData);
|
InitCommonControlsEx(&cceData);
|
||||||
|
|
||||||
/*
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
#if(WINVER >= 0x0601)
|
|
||||||
pTaskbarList=NULL;
|
pTaskbarList=NULL;
|
||||||
|
|
||||||
taskbarCreatedEvent=RegisterWindowMessage("TaskbarButtonCreated");
|
taskbarCreatedEvent=RegisterWindowMessage("TaskbarButtonCreated");
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
m_hIcon = NULL;
|
m_hIcon = NULL;
|
||||||
|
|
||||||
@@ -287,13 +281,13 @@ void LoadingWindow_Win32::SetProgress(const int progress)
|
|||||||
m_progress=progress;
|
m_progress=progress;
|
||||||
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
||||||
::SendMessage(hwndItem,PBM_SETPOS,progress,0);
|
::SendMessage(hwndItem,PBM_SETPOS,progress,0);
|
||||||
/*
|
|
||||||
#if(WINVER >= 0x0601)
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
if(pTaskbarList) {
|
if(pTaskbarList) {
|
||||||
pTaskbarList->SetProgressValue(hwnd, m_progress, m_totalWork);
|
pTaskbarList->SetProgressValue(hwnd, m_progress, m_totalWork);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadingWindow_Win32::SetTotalWork(const int totalWork)
|
void LoadingWindow_Win32::SetTotalWork(const int totalWork)
|
||||||
@@ -301,13 +295,13 @@ void LoadingWindow_Win32::SetTotalWork(const int totalWork)
|
|||||||
m_totalWork=totalWork;
|
m_totalWork=totalWork;
|
||||||
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
||||||
SendMessage(hwndItem,PBM_SETRANGE32,0,totalWork);
|
SendMessage(hwndItem,PBM_SETRANGE32,0,totalWork);
|
||||||
/*
|
|
||||||
#if(WINVER >= 0x0601)
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
if(pTaskbarList) {
|
if(pTaskbarList) {
|
||||||
pTaskbarList->SetProgressValue(hwnd, m_progress, m_totalWork);
|
pTaskbarList->SetProgressValue(hwnd, m_progress, m_totalWork);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadingWindow_Win32::SetIndeterminate(bool indeterminate) {
|
void LoadingWindow_Win32::SetIndeterminate(bool indeterminate) {
|
||||||
@@ -316,25 +310,22 @@ void LoadingWindow_Win32::SetIndeterminate(bool indeterminate) {
|
|||||||
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
HWND hwndItem = ::GetDlgItem( hwnd, IDC_PROGRESS );
|
||||||
|
|
||||||
if(indeterminate) {
|
if(indeterminate) {
|
||||||
/*
|
|
||||||
#if(WINVER >= 0x0601)
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
if(pTaskbarList) {
|
if(pTaskbarList) {
|
||||||
pTaskbarList->SetProgressState(hwnd, TBPF_INDETERMINATE);
|
pTaskbarList->SetProgressState(hwnd, TBPF_INDETERMINATE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
SetWindowLong(hwndItem,GWL_STYLE, PBS_MARQUEE | GetWindowLong(hwndItem,GWL_STYLE));
|
SetWindowLong(hwndItem,GWL_STYLE, PBS_MARQUEE | GetWindowLong(hwndItem,GWL_STYLE));
|
||||||
SendMessage(hwndItem,PBM_SETMARQUEE,1,0);
|
SendMessage(hwndItem,PBM_SETMARQUEE,1,0);
|
||||||
} else {
|
} else {
|
||||||
SendMessage(hwndItem,PBM_SETMARQUEE,0,0);
|
SendMessage(hwndItem,PBM_SETMARQUEE,0,0);
|
||||||
SetWindowLong(hwndItem,GWL_STYLE, (~PBS_MARQUEE) & GetWindowLong(hwndItem,GWL_STYLE));
|
SetWindowLong(hwndItem,GWL_STYLE, (~PBS_MARQUEE) & GetWindowLong(hwndItem,GWL_STYLE));
|
||||||
/*
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
#if(WINVER >= 0x0601)
|
|
||||||
if(pTaskbarList) {
|
if(pTaskbarList) {
|
||||||
pTaskbarList->SetProgressState(hwnd, TBPF_NORMAL);
|
pTaskbarList->SetProgressState(hwnd, TBPF_NORMAL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,10 @@
|
|||||||
#include "archutils/Win32/AppInstance.h"
|
#include "archutils/Win32/AppInstance.h"
|
||||||
|
|
||||||
#if(WINVER >= 0x0601)
|
#if(WINVER >= 0x0601)
|
||||||
|
#define PROGRESS_IN_TASKBUTTON
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
#include "Shobjidl.h"
|
#include "Shobjidl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -35,12 +39,10 @@ private:
|
|||||||
DWORD pumpThreadId;
|
DWORD pumpThreadId;
|
||||||
HANDLE guiReadyEvent;
|
HANDLE guiReadyEvent;
|
||||||
|
|
||||||
/*
|
#ifdef PROGRESS_IN_TASKBUTTON
|
||||||
#if WINVER >= 0x0601
|
|
||||||
UINT taskbarCreatedEvent;
|
UINT taskbarCreatedEvent;
|
||||||
ITaskbarList3 *pTaskbarList;
|
ITaskbarList3 *pTaskbarList;
|
||||||
#endif
|
#endif
|
||||||
*/
|
|
||||||
|
|
||||||
volatile bool runMessageLoop;
|
volatile bool runMessageLoop;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user