首页 > 解决方案 > Autohotkey - 发送 ctrl+ 以在 Windows 文件资源管理器中自动调整列宽

问题描述

使用 Autohotkey,我想将“ctrl+”发送到文件资源管理器,以自动调整列宽。
手动,它是 ctrl+(小键盘中的 +)。

下面的代码有效,但仅适用于一级文件夹,如果我在文件夹中打开文件夹则无效。
有没有办法为我可能打开的每个子文件夹再次发送“ctrl+”?

Gui, +LastFound
DllCall("RegisterShellHookWindow", UInt, WinExist())
MsgNum := DllCall("RegisterWindowMessage", Str, "SHELLHOOK")
OnMessage(MsgNum, "ShellMessage")
Return

ShellMessage(wParam, lParam) {
 wTitle = ahk_id %lParam%
 WinGet, pname, ProcessName, %wTitle%
 If (wParam != 1 || pname != "Explorer.exe")
  Return
 WinActivate, %wTitle%
 Send ^{NumpadAdd}   ;ctrl+ (numpad)
}

标签: windowsautohotkeyexplorer

解决方案


推荐阅读