Jump to content

ControlFocus()


Recommended Posts

If I wanted to set focus on a certain control such as an Edit control, would I do this:

ControlFocus("Find Player", "", "Edit1")

Assuming "Edit1" was the correct classnameNN.

If this is the correct way, how do I check if this control has focus or not? :D

While Alive() {
	 DrinkWine();
}
AutoIt Programmer
Link to comment
Share on other sites

This is the order.

Create Code > Test > Get Stuck > Look at Help File > Modify Code > Test > Get Stuck > Repeat() > After 10 times then post question. Okay so test it out, then tell use how it went. If you want to test if it has focus, and it is an edit start typing if it shows up where you set he focus ooooo it has focus.

Link to comment
Share on other sites

If I wanted to set focus on a certain control such as an Edit control, would I do this:

ControlFocus("Find Player", "", "Edit1")

Assuming "Edit1" was the correct classnameNN.

If this is the correct way, how do I check if this control has focus or not? :D

Thats not hard.

Run("notepad.exe")
WinWait("[CLASS:Notepad]")

Sleep(1000)

$Control = ControlGetFocus("[CLASS:Notepad]")

If Not $Control Then
    MsgBox(16, "Error", "Control not focused")
Else
    MsgBox(0, "", $Control)
EndIf

:P

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...