本帖最后由 水木子 于 2011-2-14 00:06 编辑
有啊!
#include <WinAPI.au3>
#include <GuiEdit.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUICreate("Form1", 400, 300)
$Inputa = GUICtrlCreateInput("A", 50, 50, 100, 21)
$Inputb = GUICtrlCreateInput("B", 50, 100, 100, 21)
$Inputc = GUICtrlCreateInput("C", 50, 150, 100, 21)
$Inputd = GUICtrlCreateInput("D", 50, 200, 100, 21)
$Button1 = GUICtrlCreateButton("E", 250, 100, 100, 30)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button1
MsgBox(0, '', '相应回车键')
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
Local $hWndFrom, $iIDFrom, $iCode, $hWndEdit
$nID = BitAND($iwParam, 0x0000FFFF)
;$iIDFrom = _WinAPI_LoWord($iwParam)
$iCode = _WinAPI_HiWord($iwParam)
Switch $iCode
Case $EN_KILLFOCUS
Switch $nID
Case $Inputa To $Inputd
MsgBox(0, '', GUICtrlRead($nID))
EndSwitch
EndSwitch
EndFunc ;==>WM_COMMAND
|