the123punch Posted September 15, 2008 Share Posted September 15, 2008 Hi, I am building a GUI interface for a user creation application to create a user in several different databases. I have 2 questions: 1) Is there a way to catch the OnLostFocus() event of an input box (text box) in the GUI, so that an action is performed right after? 2) What I want to do after the onLostFocus() event of the input box is to search in the Active Directory and look if we have that user already created in AD. Is there a code reference which I could look at to know how it is done for the Active Directory handling? I would really appreciate it if someone could help me on that one very soon. Thanks. the123punch Link to comment Share on other sites More sharing options...
martin Posted September 15, 2008 Share Posted September 15, 2008 (edited) Hi,I am building a GUI interface for a user creation application to create a user in several different databases.I have 2 questions:1) Is there a way to catch the OnLostFocus() event of an input box (text box) in the GUI, so that an action is performed right after?2) What I want to do after the onLostFocus() event of the input box is to search in the Active Directory and look if we have that user already created in AD. Is there a code reference which I could look at to know how it is done for the Active Directory handling?I would really appreciate it if someone could help me on that one very soon.Thanks.the123punchYou can use the notification $EN_KILLFOCUSmsdn link Edited September 15, 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...
rasim Posted September 16, 2008 Share Posted September 16, 2008 Hi, I am building a GUI interface for a user creation application to create a user in several different databases. I have 2 questions: 1) Is there a way to catch the OnLostFocus() event of an input box (text box) in the GUI, so that an action is performed right after? 2) What I want to do after the onLostFocus() event of the input box is to search in the Active Directory and look if we have that user already created in AD. Is there a code reference which I could look at to know how it is done for the Active Directory handling? I would really appreciate it if someone could help me on that one very soon. Thanks. the123punch Example: #include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Test GUI", 300, 200) $hInput = GUICtrlCreateInput("", 50, 50, 200, 20) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState() While GUIGetMsg() <> -3 WEnd Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $IdFrom = BitAnd($wParam, 0x0000FFFF) Local $iCode = BitShift($wParam, 16) Switch $IdFrom Case $hInput Switch $iCode Case $EN_KILLFOCUS ConsoleWrite("!> Lost focus" & @LF) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Link to comment Share on other sites More sharing options...
the123punch Posted September 16, 2008 Author Share Posted September 16, 2008 martin, thank you for taking the time to answer. I referred myself to this link but wasn't quite sure how and where to start. rasim, thanks a lot for your code snippet. It is really helpful and working perfectly. I am wondering if there is also a onTextChange Event for an inputBox or do I have to build it manually?? Thanks. the123punch Link to comment Share on other sites More sharing options...
wraithdu Posted September 16, 2008 Share Posted September 16, 2008 Edit Control (also Input Control) Notifications -http://msdn.microsoft.com/en-us/library/cc656459(VS.85).aspxYou'll want to use EN_CHANGE or EN_UPDATE. Link to comment Share on other sites More sharing options...
martin Posted September 16, 2008 Share Posted September 16, 2008 martin, thank you for taking the time to answer. I referred myself to this link but wasn't quite sure how and where to start.rasim, thanks a lot for your code snippet. It is really helpful and working perfectly. I am wondering if there is also a onTextChange Event for an inputBox or do I have to build it manually??Thanks.the123punchThat means you didn't follow the link I gave or you could have seen the answer yourself 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...
the123punch Posted September 17, 2008 Author Share Posted September 17, 2008 That means you didn't follow the link I gave or you could have seen the answer yourself I did follow the link provided but didnt see a concrete example so didn't really know how to use it.. I'm still a newb to AutoIt...thx for the suggestion anyway 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