smahdi83 Posted September 26, 2007 Share Posted September 26, 2007 (edited) Hi, How can I check if a certain textbox lost focus? Please this is really important and I have no clue on how to do that? Thanks, Edited September 26, 2007 by smahdi83 Link to comment Share on other sites More sharing options...
smahdi83 Posted September 26, 2007 Author Share Posted September 26, 2007 Is there any way in Autoit to trigger an event as soon as a textbox loses focus? I can't seem to find anything to help me do that. Link to comment Share on other sites More sharing options...
martin Posted September 26, 2007 Share Posted September 26, 2007 (edited) Hi, How can I check if a certain textbox lost focus? Please this is really important and I have no clue on how to do that? Thanks, You could do it like this (assuming a textbox is an edit)- #INCLUDE <GUICONSTANTS.AU3> #include <constants.au3> Global Const $WM_COMMAND = 0x0111 Global Const $EN_KILLFOCUS = 0x0200 $w1 = GUICreate('edit lost focus') $edit1 = GUICtrlCreateEdit("some text", 20, 20, 120, 80) $edit2 = GUICtrlCreateEdit("some text", 20, 120, 120, 80) GUIRegisterMsg($WM_COMMAND, "MY_WM_COMMAND") GUISetState() While GUIGetMsg() <> -3 WEnd Func MY_WM_COMMAND($hWnd, $msg, $wParam, $lParam) Local $nNotifyCode = BitShift($wParam, 16) Local $nID = BitAND($wParam, 0xFFFF) Local $hCtrl = $lParam Switch $nID Case $edit1 Switch $nNotifyCode Case $EN_KILLFOCUS MsgBox(0, 'EDIT LOST FOCUS', 'from Edit1') EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>MY_WM_COMMAND It's actually easy to find the notifications and messages for a control. Have a look here.] EDIT: Added link to msdn Edited September 26, 2007 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...
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