Expanding on Nine's task bar adventures... The overlay icon and tooltip were the only other interesting task bar things to me, so I added those + examples
#include <GUIConstantsEx.au3>
#include <WinAPIIcons.au3> ; For _WinAPI_DestroyIcon
#include <WinAPIShellEx.au3> ; For _WinAPI_ShellExtractIcon
Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}"
Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}"
Global Const $tagITaskbarList3 = _
"HrInit hresult();" & _
"AddTab hresult(hwnd);" & _
"DeleteTab hresult(hwnd);" & _
"ActivateTab hresult(hwnd);" & _
"SetActiveAlt hresult(hwnd);" & _
"MarkFullscreenWindow hresult(hwnd;boolean);" & _
"SetProgressValue hresult(hwnd;uint64;uint64);" & _
"SetProgressState hresult(hwnd;int);" & _
"RegisterTab hresult(hwnd;hwnd);" & _
"UnregisterTab hresult(hwnd);" & _
"SetTabOrder hresult(hwnd;hwnd);" & _
"SetTabActive hresult(hwnd;hwnd;dword);" & _
"ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _
"ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _
"ThumbBarSetImageList hresult(hwnd;ptr);" & _
"SetOverlayIcon hresult(hwnd;ptr;wstr);" & _
"SetThumbnailTooltip hresult(hwnd;wstr);" & _
"SetThumbnailClip hresult(hwnd;ptr);"
Example()
Func Example()
Local $hGUI = GUICreate("AutoIt v3", 400, 100)
GUISetState()
Local $oTaskBar = TB_Init()
TB_ToolTip($oTaskBar, $hGUI, "Working...")
; Load an icon -- this is a blue refresh on Win11
Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 238, 32, 32)
TB_SetOverlayIcon($oTaskBar, $hGUI, $hIcon, "Blue refresh")
For $i = 1 To 100
TB_SetProgress($oTaskBar, $hGUI, $i, 100)
Sleep(25)
Next
; Destroy the old icon
_WinAPI_DestroyIcon($hIcon)
Local $hSecondIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 300, 32, 32)
TB_SetOverlayIcon($oTaskBar, $hGUI, $hSecondIcon, "Green checkmark")
TB_Flash($oTaskBar, $hGUI, 4, 300)
TB_ToolTip($oTaskBar, $hGUI, "Waiting for you to close the window")
While True
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
; Clear the icon overlay
TB_SetOverlayIcon($oTaskBar, $hGUI, Null)
_WinAPI_DestroyIcon($hSecondIcon)
EndFunc ;==>Example
Func TB_Init()
Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3)
$oTB.HrInit()
Return $oTB
EndFunc ;==>TB_Init
Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted)
$oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted)
EndFunc ;==>TB_SetProgress
Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay)
For $i = 1 To $iTimes
$oTB.SetProgressState($hWnd, 0)
Sleep($iDelay)
$oTB.SetProgressValue($hWnd, 100, 100)
Sleep($iDelay)
Next
$oTB.SetProgressState($hWnd, 0)
EndFunc ;==>TB_Flash
; These are icons added to your taskbar icon, showing status usually. Each window only gets 1. Set $hIcon to NULL to clear.
; (Win11) Teams uses this to show your status (busy, free, inactive) and Outlook uses it to show if you have an unread email
Func TB_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "")
$oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText)
EndFunc ;==>TB_SetOverlayIcon
; Depending on settings and version, this may be difficult to see. On Win11 with taskbar previews, it is only visible after hovering over the preview window.
Func TB_ToolTip(ByRef $oTB, $hWnd, $sTooltip)
$oTB.SetThumbnailTooltip($hWnd, $sTooltip)
EndFunc ;==>TB_ToolTip