Autohotkey 脚本适用于除“This PC”之外的每个文件夹

问题描述

我使用这个脚本来自动调整 Windows 文件资源管理器中每一列的宽度,当我打开“这台电脑”时它可以完美地分开:驱动器名称被截断,我必须输入“ctrl +”(+在小键盘中)自动调整。 是否可以调整脚本?

; Sending "ctrl+" (+ in the numpad) to File Explorer to auto-adjust columns width,even for nested folders
; https://stackoverflow.com/questions/65048189/autohotkey-send-hotkeys-to-nested-folders
; sendinput ^+6 ; ctrl+shift+6 details list 
; sendinput,^{NumpadAdd}; ctrl+ (+ numpad)


;No need to create a gui,A_ScriptHwnd is used for this
DllCall("RegisterShellHookWindow",UInt,A_ScriptHwnd)
MsgNum := DllCall("RegisterWindowMessage",Str,"SHELLHOOK")
OnMessage(MsgNum,"ShellMessage")
Return

ShellMessage(wParam,lParam) 
{
    static _time := 0
    if (wParam = 6 or wParam = 1 or wParam = 3 or wParam = 4 or wParam = 13 or wParam = 14) && (A_TickCount - _time > 150 && WinActive("A") = lParam)

    {
        _time := A_TickCount
        WinGet,pname,ProcessName,% "ahk_id " lParam
        if (pname = "explorer.exe")
        {
            ControlFocus,DirectUIHWND2,% "ahk_id " lParam
            sendinput,^{NumpadAdd}
            sendinput ^+6
            sendinput,^{NumpadAdd} ;again just to be sure
        }
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)