i notice that PROGRESS from Fivewin will not show "progress" in Icon of Tasklist like my Xbase++ "self made" PROGRESS
i will make a Sample for Fivewin
---
Xbase++ CODE using Qt4Xb Syntax
- Code: Select all Expand view
- // iTasklist Interface
//
METHOD DXE_ProgressBar:StartProgressMode()
LOCAL p := 0
LOCAL nRet := 0
LOCAL r,pu,pwb
IF ::UseiTasklist = .T.
::iTask := @user32:RegisterWindowMessageW(L("TaskbarButtonCreated"))
ELSE
::iTask := 0
ENDIF
IF ::iTask = 0
::pTaskBarlist := 0
ELSE
@ole32:CoCreateInstance( UuidFromString(CLSID_TaskbarList),;
0,;
CLSCTX_ALL,;
UuidFromString(IID_ITaskbarList3),;
@p )
IF p <> S_OK
::pTaskBarlist := p
::nHrInit := ::TBL1_HrInit()
IF ::nHrInit <> S_OK
* Msgbox( FormatErrorMessage( ::nHrInit ), "Error iTasklist" )
::pTaskBarlist := 0
ENDIF
// "Turning on" progress mode and setting the initial progress value to 0.
// m_pTaskBarList3->SetProgressState(m_hWnd, TBPF_NORMAL);
// m_pTaskBarList3->SetProgressValue(m_hWnd, 0, 100);
IF ::pTaskBarlist <> 0
nRet := ::TBL3_SetProgressState( ::MainHandle, TBPF_NORMAL )
nRet := ::TBL3_SetProgressValue( ::MainHandle, ::nValue, ::nMaximum )
ENDIF
ENDIF
ENDIF
RETURN
// ---------------------------------------------------------------------------------
METHOD DXE_ProgressBar:EndProgressMode()
LOCAL nRet
IF !EMPTY(::pTaskBarlist)
// m_pTaskBarList3->SetProgressState(m_hWnd, TBPF_NOPROGRESS);
// m_pTaskBarList3->Release();
// m_pTaskBarList3 = NULL;
nRet := ::TBL3_SetProgressState( ::MainHandle, TBPF_NOPROGRESS )
nRet := ::TBL3_Release()
IF NIL <> ::nHrInit
nRet := ::TBL1_Release()
::nHrInit := NIL
ENDIF
::pTaskBarlist := 0
@ole32:CoUninitialize()
ENDIF
RETURN
// ---------------------------------------------------------------------------------
METHOD DXE_ProgressBar:TBL1_HrInit()
IF !Empty(::pTaskBarlist)
ITaskbarList_uuidof()
// ::pTaskBarlist will be filled in HrInit
::nLastError := ITaskbarList_HrInit(::pTaskBarlist)
ENDIF
RETURN ::nLastError
// ---------------------------------------------------------------------------------
METHOD DXE_ProgressBar:TBL1_Release()
LOCAL bError
LOCAL oError
IF !EMPTY(::pTaskBarlist)
bError := ErrorBlock( {|oErr| Break( oErr ) } )
BEGIN SEQUENCE
::nLastError := ITaskbarList_Release(::pTaskBarlist)
RECOVER USING oError
ENDSEQUENCE
ErrorBlock( bError )
ENDIF
RETURN ::nLastError
// ---------------------------------------------------------------------------------
METHOD DXE_ProgressBar:TBL3_SetProgressState(hwnd, tbpFlags)
DEFAULT hwnd TO ::MainHandle,;
tbpFlags TO TBPF_NORMAL
IF !Empty(::pTaskBarlist)
::nLastError := ITaskbarList3_SetProgressState(::pTaskBarlist, hwnd, tbpFlags )
ENDIF
RETURN ::nLastError
// ---------------------------------------------------------------------------------
METHOD DXE_ProgressBar:TBL3_SetProgressValue(hwnd, ullCompleted, ullTotal)
DEFAULT hwnd TO ::MainHandle,;
ullCompleted TO ::nValue ,;
ullTotal TO ::nMaximum
IF !Empty(::pTaskBarlist)
::nLastError := ITaskbarList3_SetProgressValue(::pTaskBarlist,hwnd,ullCompleted,ullTotal)
ENDIF
RETURN ::nLastError
// ---------------------------------------------------------------------------------
METHOD DXE_ProgressBar:TBL3_Release()
LOCAL bError
LOCAL oError
IF !Empty(::pTaskBarlist)
bError := ErrorBlock( {|oErr| Break( oErr ) } )
BEGIN SEQUENCE
::nLastError := ITaskbarList3_Release(::pTaskBarlist)
RECOVER USING oError
ENDSEQUENCE
ErrorBlock( bError )
ENDIF
RETURN ::nLastError