Here's a script for you to try the effect.
Skrommel
;MiddleToClose.ahk
; MiddleClick a taskbar button to close it
; To run, save to file MiddleToClose.ahk
; and download and install AutoHotkey from www.autohotkey.com
;Skrommel @2006
#SingleInstance,Force
SetWinDelay,0
enabled=0
Loop
{
Sleep,50
oldwinid:=winid
oldctrl:=ctrl
MouseGetPos,x,y,winid,ctrl
WinGetClass,class,ahk_id %winid%
If (class<>"Shell_TrayWnd")
lastwinid:=oldwinid
If (class="Shell_TrayWnd" And ctrl="ToolbarWindow322" And enabled=0)
{
Hotkey,MButton,CLOSE,On
WinActivate,ahk_id %winid%
enabled=1
}
If ((class<>"Shell_TrayWnd" Or ctrl<>"ToolbarWindow322") And enabled=1)
{
Hotkey,MButton,CLOSE,Off
WinActivate,ahk_id %lastwinid%
enabled=0
}
}
CLOSE:
Send,{LButton}
WinWaitNotActive,ahk_class Shell_TrayWnd,,1
If ErrorLevel=1
Return
Send,!{F4}
Return