本帖最后由 水木子 于 2014-7-7 19:15 编辑
#include <WinAPI.au3>
#include <WindowsConstants.au3>
GUICreate('', 400, 200)
$Input1 = GUICtrlCreateInput('', 50, 80, 100, 21)
$Input2 = GUICtrlCreateInput('', 250, 80, 100, 21)
$Input3 = GUICtrlCreateInput('', 50, 130, 100, 21)
$Input4 = GUICtrlCreateInput('', 250, 130, 100, 21)
$Label1 = GUICtrlCreateLabel('', 0, 30, 400, 17, 1)
GUISetState()
GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
Do
Until GUIGetMsg() = -3
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
Local $iFromID, $iMsgID, $iControlID
$iControlID = BitAND($iwParam, 0x0000FFFF)
$iFromID = _WinAPI_LoWord($iwParam)
$iMsgID = _WinAPI_HiWord($iwParam)
Switch $iMsgID
Case 1024
ConsoleWrite('ControlID =' & $iControlID & ' MsgID = ' & $iMsgID & @CRLF)
GUICtrlSetData($Label1, '输入框 ' & ($iControlID - $Input1) + 1 & ' 正在录入数据。')
EndSwitch
EndFunc ;==>WM_COMMAND
|