【问题标题】:Can't activate Windows Explorer window无法激活 Windows 资源管理器窗口
【发布时间】:2018-07-28 09:00:25
【问题描述】:

由于某种原因,我无法激活 Windows 资源管理器窗口:

(即默认文件管理器。不要与 Internet Explorer 混淆)

任何想法如何解决它?谢谢。

我在 32 位 Win7 上试过。可能它适用于较新的 Windows 版本(我不知道)。

#singleInstance, force

f1::
    ; This works:
    ; (Even if multiple Notepad windows are opened)
    ; winActivate, ahk_class Notepad ahk_exe Notepad.exe

    ; This doesn't work:
    ; (Even if only one Explorer window is opened)
    winActivate, ahk_class CabinetWClass ahk_exe explorer.exe
return

【问题讨论】:

  • 资源管理器窗口处于活动状态时会显示哪些信息?
  • @user3419297 ahk_class CabinetWClass ahk_exe explorer.exe,如我的代码所示。我也试过 ExplorerWClass - 不起作用。很奇怪。

标签: autohotkey


【解决方案1】:

什么信息显示了这个 MsgBox?

f2::
list := ""
numberOfwindows := ""
wins := ""
WinGet, id, list, ahk_class CabinetWClass ahk_exe explorer.exe
Loop, %id%
{
    numberOfwindows := A_Index
    this_ID := id%A_Index%
    WinGetTitle, title, ahk_id %this_ID%
    wins .= A_Index A_Space title ? A_Index A_Space title "`n" : "" 
}
MsgBox, number of explorer windows = %numberOfwindows%`n`n%wins%
return

【讨论】:

  • 它显示number of explorer windows =,即=之后什么都没有。
  • 尝试以管理员身份运行脚本,将this添加到自动执行部分。
  • 感谢您对我的帮助。但目前,没有任何变化:= 之后没有任何变化。顺便问一下,它对你有用吗?
  • 是的,在 Win7 64 位和 Win10 64 位上。卸载 AHK 并重新启动后以管理员身份重新安装可能会有所帮助。
猜你喜欢
  • 1970-01-01
  • 2018-06-17
  • 1970-01-01
  • 2016-04-17
  • 1970-01-01
  • 2017-01-28
  • 1970-01-01
  • 2014-07-27
  • 1970-01-01
相关资源
最近更新 更多