Eigensheep Posted May 12, 2008 Share Posted May 12, 2008 Does anyone know how you can detect when the user changes the value of an inputbox? For example is the value is "Open" and the user drags and drops the value "Close" into it, how can I handle this event? Thanks for any help. Link to comment Share on other sites More sharing options...
d4rk Posted May 12, 2008 Share Posted May 12, 2008 While 1 if $input<>"Open" then mgbox(64,"","you changed it ...") endif Wend [quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys Link to comment Share on other sites More sharing options...
martin Posted May 12, 2008 Share Posted May 12, 2008 (edited) Does anyone know how you can detect when the user changes the value of an inputbox? For example is the value is "Open" and the user drags and drops the value "Close" into it, how can I handle this event? Thanks for any help.This will tell you what is in the inputbox all the time it is displayed. Global $handle, $SetTimer Dim $Folder $handle = DllCallbackRegister("_ReadIPBox", "int", "") $SetTimer = DllCall("User32.dll", "int", "SetTimer", "hwnd", 0, "int", 0, "int", 500, "ptr", DllCallbackGetPtr($handle)) $SetTimer = $SetTimer[0] $answer = InputBox("Question", "Where were you born?", "Planet Earth", "", _ -1, -1, 0, 0) DllCallbackFree($handle) DllCall("user32.dll", "int", "KillTimer", "hwnd", 0, "int", $SetTimer) Func _ReadIPBox() If WinExists("Question") Then ConsoleWrite(ControlCommand("Question","Where were you born?","Edit1","GetLine", 1) & @CRLF) EndIf EndFunc Edited May 12, 2008 by martin pixelsearch and Musashi 2 Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
danielkza Posted May 12, 2008 Share Posted May 12, 2008 Using EN_CHANGE notification: #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <WIndowsConstants.au3> #include <WinAPI.au3> $GUI = GuiCreate("Input change test",200,60) $Input = GUICtrlCreateInput("Type Here",10,15,180,30) GuiRegisterMsg($WM_COMMAND,"WM_COMMAND") GuiSetState() Do Until GUiGetMsg() = $GUI_EVENT_CLOSE Func WM_COMMAND($hWnd,$msgID,$wParam,$lParam) If _WinAPI_HiWord($wParam) = $EN_CHANGE Then MsgBox(0,"Text Changed","New Text :" & GUICtrlRead($Input)) EndIf EndFunc Link to comment Share on other sites More sharing options...
martin Posted May 13, 2008 Share Posted May 13, 2008 (edited) @ d4rk, danielkza The op asked for inputbox not GuiCtrlCreateInput. If NumberDaemon meant GuiCtrlCreateInput then I think danielkza's solution is correct and mine in incorrect. @ d4rk To read the contents of an input you need GuiCtrlRead($input). Edited May 13, 2008 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Eigensheep Posted May 13, 2008 Author Share Posted May 13, 2008 Thanks for the help guys, I've managed to get it working fine now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now