Taskbar monitor and controller
Using this module you can monitor and control Windows Taskbar buttons. Your script can get information about windows currently displayed in Taskbar as well as hide, delete or move its buttons.
Taskbar | Taskbar monitor and controller |
Count | Get the number of buttons in the Taskbar. |
Define | Get information about Taskbar buttons. |
Flash | Flash the Taskbar button. |
Focus | Focus the Taskbar. |
Disable | Disable the Taskbar. |
GetHandle | Get the Hwnd of the Taskbar. |
GetRect | Get Taskbar button placement. |
Hide | Hide Taskbar button. |
Move | Move Taskbar button. |
Remove | Remove Taskbar button. |
Example | |
About |
Taskbar_Define( Filter = "", pQ = "", ByRef o1 = "~`a ", ByRef o2 = "", ByRef o3 = "", ByRef o4 = "", ByRef o5 = "", ByRef o6 = "", ByRef o7 = "" )
Get information about Taskbar buttons.
Filter | Contains process name, ahk_pid, ahk_id or 1-based position for which to return information. If you specify position as Filter, you can use output variables to store information since only 1 item will be returned in that case. If you omit this parameter, information about all buttons will be returned. |
pQ | Query parameter, by default “iwt”. |
o1..o7 | Reference to output variables. |
h | Handle. |
i | PosItion (1 based). |
w | Parent Window handle. |
p | Process Pid. |
n | Process Name. |
o | IcOn handle. |
t | Title of the parent window. |
String containing icon information per line.
Taskbar_Flash( Hwnd = 0, Options = "" )
Flash the Taskbar button.
Hwnd | Hwnd of the window to flash. |
Options | White space separated list of flash options. |
Caption | Flash caption. |
Button | Flash button. This is default option. |
All | Flash both. |
Timer | Flesh until next call of this function with empty Options argument. |
TimerFG | Flash continuously until the window comes to the foreground. |
N.R | Decimal number. N specifies number of times to flash, by defult 3, R the flash rate (0 means cursor rate, default). |
The return value specifies the window’s state before the call to the Flash function. If the window caption was drawn as active before the call, the return value is nonzero. Otherwise, the return value is zero.
Taskbar_Flash( Taskbar_Define(2, "w"), "10.200 button") ;flash first button 10 times with 200ms rate, only button
Taskbar_GetRect( Position, ByRef X = "", ByRef Y = "", ByRef W = "", ByRef H = "" )
Get Taskbar button placement.
Position | Position of the button. Use negative position to retreive client coordinates. |
X..H | Refrence to output variables, optional. |
String containing all outuput variables.
This function can be used to determine invisible buttons. Such buttons will have w & h equal to 0.
;requires that there are no grouped buttons SortTaskbar(type="R") { static WM_SETREDRAW=0xB h := Taskbar_GetHandle() SendMessage, WM_SETREDRAW, 0, , , ahk_id %h% loop, % Taskbar_Count() // 2 { s := btns := Taskbar_Define("", "ti") "`n" Sort, s, %type% s := RegExReplace( s, "([^\n]*+\n){" A_Index-1 "}", "", "", 1 ) s := SubStr(s, 1, InStr(S, "`n")-1) StringSplit, w, s, | Taskbar_Move( w2, 2 ) } SendMessage, WM_SETREDRAW, 1, , , ahk_id %h% }
Get the number of buttons in the Taskbar.
Taskbar_Count()
Get information about Taskbar buttons.
Taskbar_Define( Filter = "", pQ = "", ByRef o1 = "~`a ", ByRef o2 = "", ByRef o3 = "", ByRef o4 = "", ByRef o5 = "", ByRef o6 = "", ByRef o7 = "" )
Flash the Taskbar button.
Taskbar_Flash( Hwnd = 0, Options = "" )
Focus the Taskbar.
Taskbar_Focus()
Disable the Taskbar.
Taskbar_Disable( bDisable = true )
Get the Hwnd of the Taskbar.
Taskbar_GetHandle()
Get Taskbar button placement.
Taskbar_GetRect( Position, ByRef X = "", ByRef Y = "", ByRef W = "", ByRef H = "" )
Hide Taskbar button.
Taskbar_Hide( Handle, bHide = True )
Move Taskbar button.
Taskbar_Move( Pos, NewPos )
Remove Taskbar button.
Taskbar_Remove( Position )