Hier ist ein einfaches Schnipsel, um das aktuelle Fenster schnell mit einer Maustaste zu schließen.
Es ist eine der Aktionen, die Sie am häufigsten in Windows durchführen, und Sie werden überrascht sein, wie viel Zeit Sie sparen, indem Sie nicht mehr für das kleine X drehen müssen. Mit einer 5-Tasten-Maus finde ich das a sehr nützliche Neuzuweisung der Schaltfläche "Weiterleiten".
#IfWinActive ;Close active window when mouse button 5 is pressed
XButton2::
SendInput {Alt Down}{F4}{Alt Up}
Return
#IfWinActive
berücksichtigt Programme zu nehmen, die Tabbed-Dokumente verwenden (wie Web-Browser), hier ist eine umfangreichere Version:
;-----------------------------------------------------------------------------
; Bind Mouse Button 5 to Close Tab/Close Window command
;-----------------------------------------------------------------------------
; Create a group to hold windows which will use Ctrl+F4 instead of Alt+F4
GroupAdd, CtrlCloseGroup, ahk_class IEFrame ; Internet Explorer
GroupAdd, CtrlCloseGroup, ahk_class Chrome_WidgetWin_0 ; Google Chrome
; (Add more programs that use tabbed documents here)
Return
; For windows in above group, bind mouse button to Ctrl+F4
#IfWinActive, ahk_group CtrlCloseGroup
XButton2::
SendInput {Ctrl Down}{F4}{Ctrl Up}
Return
#IfWinActive
; For everything else, bind mouse button to Alt+F4
#IfWinActive
XButton2::
SendInput {Alt Down}{F4}{Alt Up}
Return
#IfWinActive
; In FireFox, bind to Ctrl+W instead, so that the close command also works
; on the Downloads window.
#IfWinActive, ahk_class MozillaUIWindowClass
XButton2::
SendInput {Ctrl Down}w{Ctrl Up}
Return
#IfWinActive
Visual Studio 2010 kann auf die CtrlCloseGroup
oben nicht leicht hinzugefügt werden, wie Es ist Fenster Klasse/Titel sind nicht leicht vorhersehbar (denke ich). Hier ist das Snippet ich es zu handhaben verwenden, einschließlich ein paar zusätzlichen hilfreichen Bindungen:
SetTitleMatchMode, 2 ; Move this line to the top of your script
;-----------------------------------------------------------------------------
; Visual Studio 2010
;-----------------------------------------------------------------------------
#IfWinActive, Microsoft Visual Studio
; Make the middle mouse button jump to the definition of any token
MButton::
Click Left ; put the cursor where you clicked
Send {Shift Down}{F2}{Shift Up}
Return
; Make the Back button on the mouse jump you back to the previous area
; of code you were working on.
XButton1::
Send {Ctrl Down}{Shift Down}{F2}{Shift Up}{Ctrl Up}
Return
; Bind the Forward button to close the current tab
XButton2::
SendInput {Ctrl Down}{F4}{Ctrl Up}
Return
#IfWinActive
Ich finde auch nützlich es in Outlook kartieren ALT + 1, ALT + 2 usw. zu Makros Ich schrieb, die die derzeit bewegen ausgewählte Nachricht (en) an bestimmte Ordner (z. B. "Personal Filed", "Work Filed", usw.), aber das ist ein bisschen komplizierter.
Werfen Sie einen Blick auf http://superuser.com/questions/7271/most-useful-autohotkey-scripts – Jay
diesen Link nicht mehr scheint zu arbeiten: -/ – Evildonald