oder aber über WM_COMMAND:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 487, 92, 192, 124)
$Input1 = GUICtrlCreateInput("Input1", 8, 32, 329, 21)
$Input1_Switch = False
$Button1 = GUICtrlCreateButton("Button1", 344, 32, 131, 25)
$Input2 = GUICtrlCreateInput("Input2", 8, 62, 329, 21)
$Input2_Switch = False
$Button2 = GUICtrlCreateButton("Button2", 344, 62, 131, 25)
GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(0, "Ausgabe",GUICtrlRead($Input1))
Case $Button2
MsgBox(0, "Ausgabe",GUICtrlRead($Input2))
EndSwitch
WEnd
[/autoit] [autoit][/autoit] [autoit]Func MY_WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
$nNotifyCode = BitShift($wParam, 16)
$nID = BitAND($wParam, 0x0000FFFF)
If $nNotifyCode = 256 Then
Switch $nID
Case $Input1
GUICtrlSetStyle($Button2, '')
GUICtrlSetState($Button1, $GUI_DEFBUTTON)
Case $Input2
GUICtrlSetStyle($Button1, '')
GUICtrlSetState($Button2, $GUI_DEFBUTTON)
EndSwitch
EndIf
EndFunc ;==>MY_WM_COMMAND