#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <ComboConstants.au3>
Global $iInputs_Changed = 0
GUICreate("Input Changed Demo GUI", 300, 140)
$Input_1 = GUICtrlCreateCombo("Combo", 20, 10, 260, 20)
$Input_2 = GUICtrlCreateEdit("Edit", 20, 40, 260, 20)
$Input_3 = GUICtrlCreateInput("Input", 20, 70, 260, 20)
$Exit = GUICtrlCreateButton("Exit", 20, 100, 60, 20)
GUISetState()
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $Exit
ExitLoop
EndSwitch
If $iInputs_Changed Then
_Input_Changed($iInputs_Changed)
$iInputs_Changed = 0
EndIf
WEnd
Func _Input_Changed($ID)
Printf("Input [" & $ID & "] Changed: " & GUICtrlRead($ID) & @LF)
EndFunc ;==>_Input_Changed
Func _Input_GotFocus($ID)
Printf("Input [" & $ID & "] Got Focus" & @LF)
EndFunc ;==>_Input_GotFocus
Func _Input_LostFocus($ID)
Printf("Input [" & $ID & "] Lost Focus" & @LF)
EndFunc ;==>_Input_LostFocus
Func WM_COMMAND($hWnd, $nMsg, $wParam, $lParam)
Local $nNotifyCode = BitShift($wParam, 16)
Local $nID = BitAND($wParam, 0xFFFF)
Local $hCtrl = $lParam
Switch $nID
Case $Input_1, $Input_2, $Input_3
Switch $nNotifyCode
Case $EN_CHANGE, $EN_UPDATE, $CBN_EDITCHANGE, $CBN_EDITUPDATE
$iInputs_Changed = $nID
Case $EN_SETFOCUS, $CBN_SETFOCUS
_Input_GotFocus($nID)
Case $EN_KILLFOCUS, $CBN_KILLFOCUS
_Input_LostFocus($nID)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_COMMAND
Func Printf($Str, $Line=@ScriptLineNumber)
ConsoleWrite(@LF & "+======================================================" & @LF & _
"--> Script Line (" & $Line & "):" & @LF & "!" & @TAB & $Str & @LF & _
"+======================================================")
EndFunc