我最常用的AutoHotKey脚本分享

本文分享了几个实用的AutoHotkey脚本,包括使普通编辑控件支持Ctrl+Backspace的功能、统一窗口最小化的快捷方式以及启动并激活隐藏窗口的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我最常用的AutoHotKey脚本分享。

  1. 使普通Edit控件也支持Ctrl + Backspace,来自AHK帮助。
	; Enable Ctrl+Backsp in any edit control.
	#If ActiveControlIsOfClass("Edit")
	^BS::Send ^+{Left}{Del}
	^Del::Send ^+{Right}{Del}
	#If    ; End of Class("Edit")
  1. 统一的窗口最小化快捷方式。
    通过Shift + ECS来WinMinimize最小化窗口,特定窗口使用WinClose最小化窗口。
; Shift + Esc : Minimize Current Active Window.
;   Get ahk_class name in spyxx.exe or spyxx_amd64.exe
+Esc:: 
{
	If WinActive("ahk_class TFoxMainFrm.UnicodeClass") 
	or WinActive("ahk_class YodaoMainWndClass")
	or WinActive("ahk_class NeteaseYoudaoYNoteMainWnd")
	{
		WinClose, A	; "A" for current window.
		Return
	}

	WinMinimize, A
	Return
}
  1. 启动激活隐藏窗口。 函数RunActiveHide,未启动时激活,未激活时激活,激活时最小化或关闭。
#Q::RunActiveHide("TFoxMainFrm.UnicodeClass", "D:\Program Files\Foxmail\Foxmail.exe", true)
#`::RunActiveHide("TTOTAL_CMD", "C:\Program Files\TotalCmd\TOTALCMD64.EXE")

RunActiveHide(CLASS, PATH, CLOSE = false)
{
   IfWinNotExist ahk_class %CLASS%
   {
   	Run %PATH%
   	Return
   }	

   IfWinNotActive ahk_class %CLASS%
   {
   	WinActivate
   	Return
   }
   
   If !CLOSE
   	WinMinimize	
   Else
   	WinClose

   Return
}
  1. 待续…
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值