Abivb Posted May 1, 2019 Posted May 1, 2019 Local $currentFocus = ControlGetFocus("Window1") ;This returns TListBox101 Now i want to use this one to get the handle. I am not sure how i should specify here.I tried ControlGetHandle("Window1","","[CLASSNAME:"+$currentFocus"]").It didnt work. Sorry I am new to autoit.
FrancescoDiMuro Posted May 1, 2019 Posted May 1, 2019 (edited) Hi @Abivb, and welcome to the AutoIt forums The string concat operator in AutoIt is &, so, try to use it instead of the plus symbol Edited May 1, 2019 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Abivb Posted May 1, 2019 Author Posted May 1, 2019 Thanks @FrancescoDiMuro :). I did try &. It did not work either ! Any other ideas ?
FrancescoDiMuro Posted May 2, 2019 Posted May 2, 2019 @Abivb If you look carefully in the Help file, you'll see that CLASSNAME is not a valid input for ControlGetHandle() function (and any other funxtion about Windows or Controls). Try to use CLASSNN or CLASS and INSTANCE inputs: ControlGetHandle("Window1","","[CLASSNN:" & $currentFocus & "]") In the second option, you have to split the CLASS and the INSTANCE from the CLASSNN (should be CLASS:TListBox10; INSTANCE:1) Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
Abivb Posted May 3, 2019 Author Posted May 3, 2019 aa Yes @FrancescoDiMuro ,it worked. I should be using CLASSNN. Also i should use & both sides of appending. Thanks for helping me out of this.
FrancescoDiMuro Posted May 3, 2019 Posted May 3, 2019 @Abivb Happy to have helped Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
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