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