JAFN Posted March 23, 2011 Posted March 23, 2011 I know I am probably missing the obvious again. I need a way to determine if an edit control's text has changed so that I can perform some restriction routines. I have found how to catch each keystroke but that really doesn't help. I assume it has something to do with losing focus. But the edit control seems to have few commands available. If someone could point me in the right direction it would be most appreciated. [size="2"]The second mouse gets the cheese[/size]
Moderators Melba23 Posted March 23, 2011 Moderators Posted March 23, 2011 JAFN,Search the forum for a message handler dealing with the $EN_CHANGE message - this is sent when the content of an edit changes. And if that sounds like Chinese, then I recommend reading the GUIRegisterMsg tutorial in the Wiki first. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JAFN Posted March 23, 2011 Author Posted March 23, 2011 Wow I don't think so short a tutorial as ever caused me such a headache. Way way over my current understanding level. But $EN_CHANGE despite zero documentation does make sense to me. Now just have to make it work on the whole instead of letter by letter. But I have thoughts on how to do that. Thanks again for your time. Oh, and any time I said 'edit' I meant 'input' [size="2"]The second mouse gets the cheese[/size]
Moderators Melba23 Posted March 23, 2011 Moderators Posted March 23, 2011 JAFN,An Input control is just a special case of an Edit control - so the $EN_CHANGE message is still valid. Please do ask about the problems you had understanding the tutorial - we are here to try and help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
JAFN Posted March 23, 2011 Author Posted March 23, 2011 Please do ask about the problems you had understanding the tutorial - we are here to try and help. M23Appreciated, but that tutorial was jumping way ahead in my learning curve. It might well have been written in Japanese.At some future date I will take you up on that.But I am sure I will be back many times before then Thanks [size="2"]The second mouse gets the cheese[/size]
Andreik Posted March 23, 2011 Posted March 23, 2011 (edited) Check this example: #include <WinAPI.au3> Global $EN_CHANGE = 0x300 Global $MAIN, $EDIT $MAIN = GUICreate("Example") $EDIT = GUICtrlCreateEdit("",5,5,390,390,0x00200000) GUISetState(@SW_SHOW,$MAIN) GUIRegisterMsg(0x0111,"WM_COMMAND") While True Switch GUIGetMsg() Case -3 Exit EndSwitch Sleep(10) WEnd Func WM_COMMAND($hWnd,$Msg,$wParam,$lParam) If $hWnd = $MAIN Then If _WinAPI_HiWord($wParam) = $EN_CHANGE And _WINAPI_LoWord($wParam) = $EDIT Then TrayTip("NOTIFY","Something was changed in EditBox",1) EndIf EndIf EndFunc Edited March 23, 2011 by Andreik
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