agubler Posted August 22, 2008 Share Posted August 22, 2008 Hello first post so please let me know if i missed anything in my question! I have an input box on a gui control. I want a function to be called as data is entered into the input box, is this possible? It is intended to act like a filter, so i have a dataset with files names and as the user types data into the box the file list will filter accordingly FileList A B C BB CC AA if the user types A then a function will be called to filter the file list to leave A AA I am trying to avoid having a button that requires pressing to activate the filter Many Thanks for you time and support Link to comment Share on other sites More sharing options...
evilertoaster Posted August 22, 2008 Share Posted August 22, 2008 You should be able hook the keyboard event with GUIRegisterMsg(0x0100,"SomeFunction")...then write your keypress event handler. Link to comment Share on other sites More sharing options...
agubler Posted August 23, 2008 Author Share Posted August 23, 2008 You should be able hook the keyboard event with GUIRegisterMsg(0x0100,"SomeFunction")...then write your keypress event handler.Can you possibly give me an example of this? Link to comment Share on other sites More sharing options...
martin Posted August 23, 2008 Share Posted August 23, 2008 Hello first post so please let me know if i missed anything in my question! I have an input box on a gui control. I want a function to be called as data is entered into the input box, is this possible? It is intended to act like a filter, so i have a dataset with files names and as the user types data into the box the file list will filter accordingly FileList A B C BB CC AA if the user types A then a function will be called to filter the file list to leave A AA I am trying to avoid having a button that requires pressing to activate the filter Many Thanks for you time and supportYou need to use $EN_CHANGE which is received through the WM_COMMAND mesage. You could do something like this ;create your gui and your edit. Say the edit is $Ed :register a function to be called when the message $WM_COMMAND is received GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") Func _WM_COMMAND($hWnd, $imsg, $iwParam, $ilParam) $nNotifyCode = BitShift($iwParam, 16) $nID = BitAND($iwParam, 0x0000FFFF) If $nNotifyCode = $EN_CHANGE Then ;is the change in $Ed? If $ilParam <> GUICtrlGetHandle($Ed) Then ;do something EndIf EndIf Return $GUI_RUNDEFMSG EndFunc Make the ;do something as short as possible. If you need a lot of code which could take a significant time then you might get problems because _WM_COMMAND could get called again while you are executing your code. In this case it is better to set a global varaiable to indicate something has to be done. Then detect the state of this global variable in your main idle loop and do whatever needs to be done, then set the variable back to the 'nothing-to-do' state. 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...
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