I have an input control, and I need this:
When the user press a key and it's have the focus, show a messagebox and don't pass the pressed key into it.
When I click a button to set the text in the input (GuiCtrlSetData), don't show the messagebox.
I've tried WM_COMMAND, but the button click to set data and the keypress returns the same message code.
Global Const $WM_COMMAND = 0x0111
Local $hWnd = GUICreate("Test", 225, 100)
Local $hInput = GUICtrlCreateInput("", 10, 25)
Local $hButton = GUICtrlCreateButton("Change", 10, 60)
GUIRegisterMsg($WM_COMMAND, "MyCommand")
GUISetState(@SW_SHOWNORMAL, $hWnd)
While WinExists($hWnd)
Switch GUIGetMsg()
case -3
Exit
case $hButton
GUICtrlSetData($hInput, GUICtrlRead($hInput) & Random(1, 10, 1))
EndSwitch
WEnd
Func MyCommand($hWnd, $Msg, $wParam, $lParam)
if $lParam = GUICtrlGetHandle($hInput) then ConsoleWrite($wParam & @CRLF & $lParam & @CRLF & $Msg & @CRLF & @CRLF)
EndFunc
Thanks in advance.