Close windows by middle clicking on task bar
http://ludios.org/me...iddle-close.ahk - please read the comments at the top.
It can be used standalone but I really recommend it with Taskbar Shuffle. Unless several people test it, I can't claim it is bug-free enough to not send Alt-F4 to the wrong place. Don't use it with unsaved work open.
If anyone has any ideas on how to improve it (it's only 8 lines of actual code), let me know.
thanks
If anyone has any ideas on how to improve it (it's only 8 lines of actual code), let me know.
Try this one
enablePosCheck = 1
taskBarHeight = 23
StartY = % A_ScreenHeight - taskBarHeight
CoordMode, Mouse, Screen
~MButton::
MouseGetPos, x, y, window, control
If (y > StartY or enablePosCheck == 0) {
StringGetPos, pos, control, ToolbarWindow
if ErrorLevel {
} else {
Click
Click
Send {RButton}
Sleep, 100
Send, c{ENTER}
}
}
return 8) 8)
If anyone has any ideas on how to improve it (it's only 8 lines of actual code), let me know.
EVen better version i guess would be this
enablePosCheck = 1 taskBarHeight = 23 StartY = % A_ScreenHeight - taskBarHeight CoordMode, Mouse, Screen ~MButton:: MouseGetPos, x, y, window, control If (y > StartY or enablePosCheck == 0) { StringGetPos, pos, control, ToolbarWindow if ErrorLevel { } else { Send, {RButton} Sleep, -1 Send, c } } return
As this doesn't send Alt+F4 :!:
And just missed to appreciate ur initial work in the last post dude
Fantabulous keep it up!!
8)
#NoEnv SetBatchLines, -1 CoordMode, Mouse, Screen ~$MButton:: MouseGetPos, X, Y, win, control if (control == "ToolbarWindow322") { WinGetPos, wX, wY,,, ahk_id %win% X -= wX, Y -= wY hwnd := ControlFromPoint(X, Y, "ahk_id " win,"", cX, cY) PostMessage, 0x204, 0x2 | 0x1, cX & 0xFFFF | (cY & 0xFFFF) << 16,, ahk_id %hwnd% PostMessage, 0x205, 0x0, cX & 0xFFFF | (cY & 0xFFFF) << 16,, ahk_id %hwnd% WinWait,ahk_class #32768,,1 PostMessage,0x100,0x43,0x002E0001,,ahk_class #32768 PostMessage,0x101,0x43,0xC02E0001,,ahk_class #32768 } return ControlFromPoint(X, Y, WinTitle="", WinText="", ByRef cX="", ByRef cY="", ExcludeTitle="", ExcludeText="") { if !(hwnd := WinExist(WinTitle, WinText, ExcludeTitle, ExcludeText)) return false VarSetCapacity(pt,8) VarSetCapacity(wi,60), NumPut(60,wi) DllCall("GetWindowInfo","uint",hwnd,"uint",&wi) NumPut(X + (w:=NumGet(wi,4,"int")) - (cw:=NumGet(wi,20,"int")), pt,0) NumPut(Y + (h:=NumGet(wi,8,"int")) - (ch:=NumGet(wi,24,"int")), pt,4) Loop { child := DllCall("ChildWindowFromPointEx","uint",hwnd,"int64",NumGet(pt,0,"int64"),"uint",0x5) if !child or child=hwnd break DllCall("MapWindowPoints","uint",hwnd,"uint",child,"uint",&pt,"uint",1) hwnd := child } cX := NumGet(pt,0,"int") cY := NumGet(pt,4,"int") return hwnd }
[ profile ]
[ profile ]
Why not avoid Alt+F4 and menus entirely?this is more secure, using ControlFromPoint by Lexikos and similar menu closing method by TK. Enjoy!
that script doesn't work for me: instead of closing a program's window - it open a window that suggests me to shutdown my PC.Why not avoid Alt+F4 and menus entirely?this is more secure, using ControlFromPoint by Lexikos and similar menu closing method by TK. Enjoy!
+ it kills autoscrolling in the Firefox: when middleclick is pressed, while it's being held - if the cursor was moved - after that releasing middle click should stop the autoscrolling, but it doesn't.
not workingthis is more secure, using ControlFromPoint by Lexikos and similar menu closing method by TK. Enjoy!
Not working.Just a small script to close windows by middle clicking on their button in the task bar:
http://ludios.org/me...iddle-close.ahk - please read the comments at the top.
not working too.EVen better version i guess would be this
~MButton:: MouseGetPos,,, win ifWinExist, ahk_id %win% ahk_class Shell_TrayWnd Send {Click}!{F4} return
Howeverm if you middle-click a free space on taskbar - you'll trigger a prompt of PC shut down.