本帖最后由 wbwchina 于 2012-4-14 21:28 编辑
根据虫子樱桃大师的《AU3爱好者联盟AU3入门教程 完整版[2月9日添加书签版]》
(链接地址:http://www.autoitx.com/thread-18836-1-1.html)中的“简易英文阅读器”部分改写,做一下学习笔记。望大家多多指教!#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Dim $nr
$Form1 = GUICreate("简易英文阅读器", 409, 223, 192, 114)
$edit=GUICtrlCreateEdit("", 16, 16, 305, 137)
$Button1 = GUICtrlCreateButton("开始阅读", 40, 168, 235, 25)
$Button2 = GUICtrlCreateButton("退出", 304, 168, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$tnr=GUICtrlRead($edit)
$Voice = ObjCreate("Sapi.SpVoice")
If $tnr=""Then
$Voice.Speak ("You must type in words")
Else
$Voice.Speak ($tnr)
EndIf
Case $Button2
Exit
EndSwitch
WEnd
|