#include <GuiEdit.au3>
#include <WinAPI.au3> ; used for Lo/Hi word
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Edit Create", 400, 280)
$hEdit = _GUICtrlEdit_Create($hGUI, "请输入数据", 2, 2, 394, 128)
$hEdit2 = _GUICtrlEdit_Create($hGUI, "", 2, 142, 394, 128, BitOR($ES_READONLY, $ES_MULTILINE))
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg
Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
If Not IsHWnd($hEdit) Then $hWndEdit = GUICtrlGetHandle($hEdit)
$hWndFrom = $ilParam
$iIDFrom = _WinAPI_LoWord($iwParam)
$iCode = _WinAPI_HiWord($iwParam)
Switch $hWndFrom
Case $hEdit, $hWndEdit
Switch $iCode
Case $EN_CHANGE
_GUICtrlEdit_SetText($hEdit2, '您输入了以下数据:' & @CRLF & _GUICtrlEdit_GetText($hEdit))
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
|