从AutoHotKey GUI窗口中的按钮关闭GUI窗口不起作用

时间:2018-01-26 22:04:03

标签: user-interface autohotkey

我有AutoHotKey EnterPad Keyboard/Pad with 120 Programmable Keys

enter image description here

它的工作原理是为每个键发送一个热键按到AutoHotKey脚本,该脚本的Label function用于指定001120

下面是按下键115时调用的AHK标签函数。

我的代码允许我在任何Windows Listview组件中选择行,它将显示一个弹出GUI窗口,其中填充了所选行中的数据的文本框,每列用TAB空格分隔。然后,我可以复制或保存它或查看我喜欢的任何内容。

;---------------------------------------------------------------------115-----
; Copy Selected Windows Listview Items to Tab Spaced Text - Show popup Window Gui
; https://superuser.com/questions/814831/copy-to-clipboard-from-table-list-in-a-program-on-windows
115:
    Gui, SelectedListRowsTextGui:Destroy
    MouseGetPos, , , , ListView_hwnd, 2     ;2 means return HWND
    ControlGet, selected_row_text, List, Selected, , ahk_id %ListView_hwnd%
    Gui, SelectedListRowsTextGui: +ToolWindow +AlwaysOnTop -Caption
    Gui, SelectedListRowsTextGui:Add, Edit, vUnused_variable x11 y15 w950 h66, %selected_row_text%
    Gui, SelectedListRowsTextGui:Add, Button, x62 y84 w140 h30 +Center, Close
    Gui, SelectedListRowsTextGui:Show, ,
    return

    ButtonClose:
    Gui, SelectedListRowsTextGui:Destroy
    return

Return

问题:

我的问题是,一旦从我的AHK GUI打开弹出窗口,当我点击关闭按钮时,我的CloseButton标签不会被调用。

我意识到它可能与它嵌套在115s键标签功能之间有关,但我不确定如何最好地达到预期效果?

我尝试将CloseButton标签移到115 label之外但是仍未通过GUI的Close按钮点击来调用。

您可以看到我已将GUI SelectedListRowsTextGui命名为允许此Enterpad.ahk脚本包含许多GUI窗口以执行它将执行的不同操作。

请以正确的方式提供帮助吗?

预览此脚本在选择listview项目时创建的GUI窗口,并调用此Label函数.....

enter image description here

1 个答案:

答案 0 :(得分:1)

我现在明白了......

由于我的GUI名为SelectedListRowsTextGui,因此我必须在我的CloseButton标签名称前面添加该名称,以便现在SelectedListRowsTextGuiButtonClose并且效果很好

相关问题