顯示廣告
隱藏 ✕
看板 Programming
作者 tingyun60426. (tingyun60426.bbs@ptt.cc)
標題 [轉寄] ◇ [AHK-] AutoHotKey 入門教學 - 互動式訊息視窗
時間 2010年03月06日 Sat. AM 08:23:02


看板 EzHotKey
作者 VElysian (家瑀 致中和)
標題 [AHK-] AutoHotKey 入門教學 - 互動式訊息視窗
時間 Mon Jul 21 19:44:20 2008



Getting input from the user with MsgBox, InputBox, etc.

http://www.autohotkey.com/docs/Tutorial.htm#Dialogs



  互動式訊息視窗(Getting input from the user with MsgBox, InputBox, etc.):  


下面這個範例將會顯示一個包含(是/否)兩個按鈕的對話框(MsgBox)

        MsgBox, 4, , 要繼續嗎?
            IfMsgBox, No
                return
            ;否則,  表示你按了 "是" (這一行是註解,不會被執行)。
            MsgBox   你按了 "是".


關於 MsgBox    http://www.autohotkey.com/docs/commands/MsgBox.htm
     IfMsgBox  http://www.autohotkey.com/docs/commands/IfMsgBox.htm



結果會像這樣:
        ╴╴╴╴╴╴╴╴╴╴╴╴╴╴
       AutoHotKey.ahk            
                                 
        要繼續嗎?                
        ╴╴╴╴╴    ╴╴╴╴╴  
      ▕      ▕  ▕    否    ▏
         ̄ ̄ ̄ ̄ ̄     ̄ ̄ ̄ ̄ ̄  
         ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄

        ╴╴╴╴╴╴╴╴╴╴╴
       AutoHotKey.ahk     
                          
         你按了 "是".      
          ╴╴╴╴╴╴    
        ▕    確定  ▕    
           ̄ ̄ ̄ ̄ ̄ ̄    




其他常用指令:

 InputBox         :顯示一個輸入框(InputBox),可以輸入文字。
                    http://www.autohotkey.com/docs/commands/InputBox.htm
 FileSelectFile   :跳出檔案瀏覽視窗,可以開啟或儲存檔案。
                    http://www.autohotkey.com/docs/commands/FileSelectFile.htm
 FileSelectFolder :跳出檔案瀏覽視窗,可以開啟資料夾。
                    http://www.autohotkey.com/docs/commands/FileSelectFolder.htm


 Gui 這項指令可以讓您自由設計自己喜歡的視窗,並且做更多的事情。
     http://www.autohotkey.com/docs/commands/Gui.htm



小技巧:

或許你已經注意到,每一項指令的第一個逗號(,) 是可以被省略的。
(除非第一個參數沒有被指定(blank)或者這項指令孤獨地放在某區塊的頂部。)
  (except when the first parameter is blank
   or the command is alone at the top of a continuation section)

關於 continuation section  
http://www.autohotkey.com/docs/Scripts.htm#continuation


所以下面兩個寫法皆是可以的:

        MsgBox  這樣可以執行.
        MsgBox, 這樣還是可以執行唷~~ (多了一個逗號).



--

        主動是機會的誘餌


--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.62.93.10
ateclean:那圖做得真華麗xd1F 07/21 20:47
Kenqr:還有圖 真用心XD2F 07/21 22:55
KENyroj:超用心 推!!3F 07/22 19:19
hyster11:推4F 07/23 12:45
※ 編輯: VElysian        來自: 61.62.72.58          (08/01 19:15)
※ 看板: Programming 文章推薦值: 0 目前人氣: 0 累積人氣: 2848 
分享網址: 複製 已複製
ott 轉錄至看板 ott 時間:2010-04-26 16:55:18
r)回覆 e)編輯 d)刪除 M)收藏 ^x)轉錄 同主題: =)首篇 [)上篇 ])下篇