这里是一个别人的例子,我直接贴上来,你可以看一下#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 194, 111, 192, 114)
$Edit1 = GUICtrlCreateEdit('', 32, 40, 131, 20)
$hEdit = GUICtrlGetHandle($Edit1)
GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $msg, $wParam, $lParam)
Local $iCode = BitShift($wParam, 16) ; get the high word
Switch $lParam
Case $hEdit
Switch $iCode
Case $EN_CHANGE
$text = GUICtrlRead($Edit1)
MsgBox(0, "Contents", $text)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
|