包含GuiControl的函数不能使用热键

问题描述:

test() { 
    GuiControl, , abc, 123456789 
} 

GUI New 
GUI Add, ListBox, xm y+m w100 h100 vabc 
GUI Add, Button, xm y+m w60 h30 grun, Add 
GUI Show, Autosize 
Return 

run: 
    test() 
    return 

GuiClose: 
    ExitApp 

!1:: 
    test() 
    MsgBox 1 
    return 

我想在按Alt + 1时调用test(),但上面的代码不起作用。仅输出消息“1”。包含GuiControl的函数不能使用热键

显然我好像是误解了一些东西..怎么解决这个问题?

这显示包含列表控制的GUI的窗口并且当ALT-1按下热键将指内

test() { 
    GuiControl Alpha:, abc, 123456789 
} 

GUI Alpha: New 
GUI Add, ListBox, xm y+m w100 h100 vabc 
GUI Add, Button, xm y+m w60 h30 grun, Add 
GUI Show, Autosize 
Return 

run: 
    test() 
    return 

GuiClose: 
    ExitApp 

!1:: 
    test() 
    return 

GUI命令追加一行与“123456789”到它不同的gui线程默认情况下。您可以使用GUI Name(在上例中为Alpha:)来指定现有的GUI窗口。

+0

!!!!这很好,那就是我一直在寻找的东西。谢谢。 –