Introduction
The purpose of this class is to let you easily add some taskbar extensions to your application's windows. Including, button controls, icon overlay, taskbar progress bar, custom thumbnail preview and more.
#include taskbarInterface.ahk
tbi := new taskbarInterface(hwnd [, callbackFunction])
First include the file, then specify the handle (hwnd
) to the window to which the extensions will be applied. Optionally, if you are going to use the button extension, add a callback function
for when the user pushes the buttons. Keep your reference until you have added all extensions, here it is called tbi
.
Then add any of the following extensions,
Add up to seven buttons under the thumbnail preview.
tbi.setButtonIcon(1, hIcon) ; Set the icon for button number 1.
tbi.showButton(1) ; Show button number 1.
Show application status via small icon overlay.
tbi.setOverlayIcon(hIcon)
Show progress bar behind the taskbar icon. For changing the taskbar icon, see setTaskbarIcon()
in the full documentaion.
tbi.SetProgressType("Red") ; Use red color.
Loop 100 {
tbi.setProgress(A_Index) ; Set progress to a value between 0 and 100
someAction() ; Do something before updating the progress
}
The thumbnail preview has been clipped, to only show a portion of the window, in this case, only a listbox is shown.
Select which part of the window to show in the preview,
tbi.setThumbnailClip(x,y,x+w,y+h)
Alternatively, you can provide you own bitmap(s),
tbi.enableCustomThumnailPreview("myBitmapFunc", refreshRate:=50)
where myBitmapFunc
will be called every 50 ms
, whenever the thumbnail preview is showing. The function must return a bitmap handle. Setting the refresh rate to 0
and passing a bitmap handle to the method will set the preview to a static image.