#Include Once "window9.bi"
Enum TBPFLAG
TBPF_NOPROGRESS = 0
TBPF_INDETERMINATE = 1
TBPF_NORMAL = 2
TBPF_ERROR = 4
TBPF_PAUSED = 8
End Enum
Enum THUMBBUTTONMASK
THB_BITMAP = 1
THB_ICON = 2
THB_TOOLTIP = 4
THB_FLAGS = 8
End Enum
Enum THUMBBUTTONFLAGS
THBF_ENABLED = 0
THBF_DISABLED = 1
THBF_DISMISSONCLICK = 2
THBF_NOBACKGROUND = 4
THBF_HIDDEN = 8
THBF_NONINTERACTIVE = 10
End Enum
Type THUMBBUTTON
As THUMBBUTTONMASK dwMask
As UINT iId
As UINT iBitmap
As HICON hIcon
As WString*260 szTip
As THUMBBUTTONFLAGS dwFlags
End Type
Type ITaskbarList3Vtbl_ As ITaskbarList3Vtbl
Type ITaskbarList3
lpVtbl As ITaskbarList3Vtbl_ Ptr
End Type
Type ITaskbarList3Vtbl
QueryInterface As Function (ByVal As ITaskbarList3 Ptr,ByVal As IID Ptr, ByVal As Any Ptr Ptr) As HRESULT
AddRef As Function(ByVal As ITaskbarList3 Ptr) As HRESULT
Release As Function(ByVal As ITaskbarList3 Ptr) As HRESULT
HrInit As Function(ByVal As ITaskbarList3 Ptr) As HRESULT
AddTab As Function(ByVal As ITaskbarList3 Ptr,a As HWND) As HRESULT
DeleteTab As Function(ByVal As ITaskbarList3 Ptr,a As HWND) As HRESULT
ActivateTab As Function(ByVal As ITaskbarList3 Ptr,a As HWND) As HRESULT
SetActiveAlt As Function(ByVal As ITaskbarList3 Ptr,a As HWND) As HRESULT
MarkFullscreenWindow As Function(ByVal As ITaskbarList3 Ptr,a As HWND,fFullscreen As BOOL) As HRESULT
SetProgressValue As Function (ITL As ITaskbarList3 Ptr,hwnd As HWND ,ullCompleted As ULongInt,ullTotal As ULongInt) As HRESULT
SetProgressState As Function(ITL As ITaskbarList3 Ptr,hwnd As HWND,tbpFlags As TBPFLAG) As HRESULT
RegisterTab As Function(ITL As ITaskbarList3 Ptr,hwndTab As HWND ,hwndMDI As HWND) As HRESULT
UnregisterTab As Function(ITL As ITaskbarList3 Ptr,hWndTab As HWND) As HRESULT
SetTabOrder As Function(ITL As ITaskbarList3 Ptr,hWndTab As HWND,hWndInsertBefore As HWND) As HRESULT
SetTabActive As Function(ITL As ITaskbarList3 Ptr,hWndTab As HWND,hWndMDI As HWND,tbatFlags As DWORD)As HRESULT
ThumbBarAddButtons As Function(ITL As ITaskbarList3 Ptr,hWnd As HWND,cButtons As UINT,pButton As THUMBBUTTON Ptr)As HRESULT
ThumbBarUpdateButtons As Function(ITL As ITaskbarList3 Ptr,hWnd As HWND,cButtons As UINT,pButton As THUMBBUTTON Ptr)As HRESULT
ThumbBarSetImageList As Function(ITL As ITaskbarList3 Ptr,hWnd As HWND,himl As HIMAGELIST)As HRESULT
SetOverlayIcon As Function(ITL As ITaskbarList3 Ptr,hWnd As HWND,hIcon As HICON,pszDescription As LPCWSTR)As HRESULT
SetThumbnailTooltip As Function(ITL As ITaskbarList3 Ptr,hWnd As HWND,pszTip As LPCWSTR)As HRESULT
SetThumbnailClip As Function(ITL As ITaskbarList3 Ptr,hWnd As HWND,prcClip As LPRECT)As HRESULT
End Type
Dim Shared CLSID_TaskbarList As IID _
= Type(&h56FDF344, &hFD6D, &h11D0, {&h95, &h8a, &h00, &h60, &h97, &hc9, &ha0, &h90})
Dim Shared IID_ITaskbarList3 As IID _
= Type(&hEA1AFB91, &h9E28, &h4B86, {&h90, &hE9, &h9E, &h9F, &h8A, &h5E, &hEF, &hAF})
Dim As ITaskbarList3 Ptr tl3
Dim As HWND hwnd = OpenWindow("", 0, 0, 300, 100)
CenterWindow(hwnd) 'Mitte Desktop
ProgressBarGadget(1, 10, 10, 260, 20, 0, 100, PBS_SMOOTH)
SetGadgetColor(1,0,BGR(50,255,50),2)
CoInitialize(0)
CoCreateInstance(@CLSID_TaskBarList, 0, CLSCTX_INPROC_SERVER, @IID_ITaskBarList3, @tl3)
tl3->lpVtbl->HrInit(tl3)
tl3->lpVtbl->SetProgressValue(tl3, hwnd, 0, 100)
tl3->lpVtbl->SetProgressState(tl3, hwnd, 2)'2 green, 4 red, 8 yello
Dim As Integer ev, pct
Do
ev = WindowEvent()
If ev = EventClose Then Exit Do
If pct < 101 Then
SetWindowText(hwnd, Str(pct)+" %")
SetGadgetState(1, pct)
tl3->lpVtbl->SetProgressValue(tl3, hwnd, pct, 100)
pct += 1
Sleep 50
EndIf
Loop
If tl3 Then
tl3->lpVtbl->Release(tl3)
CoUninitialize()
EndIf |
|