“用户帐户”窗口不允许使用任何热键

问题描述

我想在ahk_class #32770窗口处于活动状态时创建一个热键,在我的情况下,通过在运行中键入netplwiz打开“用户帐户”窗口。但是,似乎没有任何热键有效。

这就是我所做的:

#NoEnv 
#Warn  
SendMode Input 
SetWorkingDir %A_ScriptDir% 

SetTitleMatchMode,2 ; A window's title can contain WinTitle anywhere inside it to be a match.
 
#ifwinactive
    #e::Run,%A_AppData%\Microsoft\Windows\Recent
        ;this doesn't work for ahk_class #32770,so I make the following workaround: 

#if winactive("ahk_class #32770") or winactive("ahk_exe explorer.exe")
    #e::Run,%A_AppData%\Microsoft\Windows\Recent
        ;but neither does this work. So I made the following test: 
    ^p::msgBox,hi
        ;and it doesn't work. 

我做错了什么或其他解决方法吗?

解决方法

应该可以。使用

结束/关闭上下文

#if #ifwinactive (如果适用)。

喜欢

#ifwinactive ahk_class#32770

#e :: Run,%A_AppData%\ Microsoft \ Windows \ Recent

#ifwinactive

#if winactive(“ ahk_class#32770”)

#e :: Run,%A_AppData%\ Microsoft \ Windows \ Recent

#if