#include <WinAPI.au3>
#include <WindowsConstants.au3>
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
GUICreate("Form1", 400, 300)
GUICtrlCreateInput("A", 50, 50, 100, 21)
GUICtrlCreateInput("B", 50, 100, 100, 21)
GUICtrlCreateInput("C", 50, 150, 100, 21)
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)
If $iCode = 0 And $nID <> $Button1 Then Send('{TAB}')
EndFunc ;==>WM_COMMAND
|