#PRE_UseX64=n
#include <Winapi.au3>
#include <ComboConstants.au3>
#include <WindowsConstants.au3>
Global Const $VK_RETURN = 0x0D
$hGui = GUICreate("Form1", 250, 150)
$Input1 = GUICtrlCreateInput("", 20, 20, 200, 21)
$Input2 = GUICtrlCreateEdit("", 20, 50, 200, 40, $WS_VSCROLL)
$Edit = GUICtrlGetHandle($Input2)
$wProcNew = DllCallbackRegister("_MyWindowProc", "ptr", "hwnd;uint;long;ptr")
$wProcOld = _WinAPI_SetWindowLong($Edit, -4, DllCallbackGetPtr($wProcNew))
GUISetState(@SW_SHOW)
$read = GUICtrlRead($Input2)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
DllCallbackFree($wProcNew)
Exit
Case $Input1
MsgBox(0, "A", "A")
;Case $Input2
;MsgBox(0,"B","B")
EndSwitch
WEnd
Func _MyWindowProc($hWnd, $uiMsg, $wParam, $lParam)
Switch $uiMsg
Case $WM_KEYUP
Switch $wParam
Case $VK_RETURN
If GUICtrlRead($Input2) <> "" And GUICtrlRead($Input2) <> $read Then
$read = GUICtrlRead($Input2)
MsgBox(0, "B", "B")
EndIf
EndSwitch
EndSwitch
Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $uiMsg, $wParam, $lParam)
EndFunc ;==>_MyWindowProc
|