Jump to content

onLostFocus with input box


the123punch
 Share

Recommended Posts

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

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

You can use the notification $EN_KILLFOCUS

msdn link

Edited 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

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

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

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

That 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...