Autoit:数组末尾的按钮

Autoit: button at end of array

我正在 AutoIT 中编写一个程序,让用户输入一个名称,然后它会在我已链接到 Active Directory 的 MSSQL 中搜索有关 cn 相似的用户或用户的信息。问题是我试图在一行的末尾添加一个按钮。单击后,会将电子邮件地址添加到剪贴板。我无法在线查找代码来帮助执行此操作。我有以下代码:

 #include <mssql.au3>
 #include <Array.au3>
 dim $title = "E-Mail address lookup"
 dim $sqlCon = _MSSQL_Con("servername", "password", "Directory3", "directory")
 dim $name = InputBox($title,"Please type the name of the person you wish to find")
 if StringLen(StringStripWS($name,3)) < 1 then
      MsgBox(0, $title, "Name cannot be empty")
 Else
      local $result = _ArrayDisplay(_MSSQL_GetRecord($sqlCon, "rbc_staff","*", "WHERE cn LIKE '%" & StringStripWS($name,3) & "%'"))
 EndIf
; I don't know, how "_MSSQL_GetRecord" returns its result. I think it should be an 1D array.
; If it is so, try the following. No extra button, but a messagebox with yes/no.
; But it should be better, if you could post a sample of the result array
If StringLen(StringStripWS($name,3)) < 1 then
    MsgBox(0, $title, "Name cannot be empty")
Else
    ; if I've right understand, the sql query gets the mail address
    Local $result = _MSSQL_GetRecord($sqlCon, "rbc_staff","*", "WHERE cn LIKE '%" & StringStripWS($name,3) & "%'")
    ; instead of showing the array
    ;_ArrayDisplay($result)
    ; ask the user, if the address should be copied to clipboard
    If MsgBox(36, 'Mail', 'You want to copy the mail address' & @CRLF & _
       $result[0] & @CRLF & 'to clipboard?') = 6 Then
        ClipPut($result[0])
    EndIf
EndIf