Qvintus Posted June 23, 2013 Posted June 23, 2013 (edited) Hello AutoIT'ers Me and my friend are using AutoIT as for controlling our Laptop connected up to a TV through Teamviewer. So far I've made my script hide/unhide and start a meeting if none is active. However we've run into a problem when we wanted to have the script let us give control rights. I know how to send the ControlClick command but problem is hitting the right person.... I've tried to use ControlListView and tried to find text to that particular class when the meeting is ongoing, however I just can't seem to extract the right information. Anyone know a good way to some how extract the list of Participants in Teamviewer Meeting? It would be much appreciated! EDIT: Some screenshot of the scripts so you might get a general understanding ControlInfo from Participants box: Best Regards Qvintus Edited June 23, 2013 by Qvintus
Qvintus Posted June 24, 2013 Author Posted June 24, 2013 *bump* nobody can guide me in the right direction?
jdelaney Posted June 24, 2013 Posted June 24, 2013 It's possible that's a window within a window? Try this out, to see if you can grab (possible) nested controls $hControl = ControlGetHandle("your window", "", "TVScrollWin1") ConsoleWrite(WinGetClassList($hControl) & @CRLF) IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Qvintus Posted June 25, 2013 Author Posted June 25, 2013 (edited) It's possible that's a window within a window? Try this out, to see if you can grab (possible) nested controls $hControl = ControlGetHandle("your window", "", "TVScrollWin1") ConsoleWrite(WinGetClassList($hControl) & @CRLF) Thanks a lot for the answer! Sadly that return nothin' even though it would seem a button + more is part of that object. I've tried $hControl = ControlGetHandle("[CLASS:TV_ControlWin]", "", "TVScrollWin1") ConsoleWrite(WinGetClassList($hControl) & @CRLF) $hControl = ControlGetHandle("[CLASS:TV_ControlWin]", "", "[CLASS:TVScrollWin;INSTANCE:1]") ConsoleWrite(WinGetClassList($hControl) & @CRLF) However for some reason if I use this: $hControl = ControlGetHandle("[CLASS:TV_ControlWin]", "", "[CLASS:TVScrollWin1]") ConsoleWrite(WinGetClassList($hControl) & @CRLF) It returns this list: SciTEWindowContent Scintilla Scintilla ToolbarWindow32 SciTeTabCtrl SciTEWindowContent Static Edit Button SciTEWindowContent Static ComboBox Edit Button Button Button Button Button Button Button Button SciTEWindowContent Static ComboBox Edit Static ComboBox Edit Button Button Button Button Button Button Button Button Button msctls_statusbar32 Tried getting info from all Edit instances, however nothin' of use turned up. Edited June 25, 2013 by Qvintus
jdelaney Posted June 25, 2013 Posted June 25, 2013 (edited) Yes, that's because the last one returns an invalid handle (""), which inside the WinGetClassList returns the class list of your active window (which was scite) ControlGetHandle Success: Returns the handle (HWND) value. Failure: Returns "" (blank string) and sets @error to 1 if no window matches the criteria. Edited June 25, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Qvintus Posted June 25, 2013 Author Posted June 25, 2013 Yes, that's because the last one returns an invalid handle (""), which inside the WinGetClassList returns the class list of your active window (which was scite) ControlGetHandle Success: Returns the handle (HWND) value. Failure: Returns "" (blank string) and sets @error to 1 if no window matches the criteria. I see... Guess I'll be needing to get hardcore to sort this out then?
jdelaney Posted June 25, 2013 Posted June 25, 2013 (edited) try this out, you might get lucky: expandcollapse popup#include <Array.au3> #include <constants.au3> #include <WinAPI.au3> $hwnd = WinGetHandle("[CLASS:TV_ControlWin]") If IsHWnd($hwnd) Then Var_GetAllWindowsControls($hwnd) Else MsgBox(1,1,"can't find your window...try again with correct class") EndIf Exit Func Var_GetAllWindowsControls($hCallersWindow) ;~ $giSubFunctionCounter += 1 ; Get all list of controls $sClassList = WinGetClassList($hCallersWindow) ; Create array $aClassList = StringSplit($sClassList, @CRLF, 2) ; Sort array _ArraySort($aClassList) _ArrayDelete($aClassList, 0) ; Loop $iCurrentClass = "" $iCurrentCount = 1 $iTotalCounter = 1 For $i = 0 To UBound($aClassList) - 1 If $aClassList[$i] = $iCurrentClass Then $iCurrentCount += 1 Else $iCurrentClass = $aClassList[$i] $iCurrentCount = 1 EndIf $hControl = ControlGetHandle($hCallersWindow, "", "[CLASSNN:" & $iCurrentClass & $iCurrentCount & "]") $text = StringRegExpReplace(ControlGetText($hCallersWindow, "", $hControl), "[\n\r]", "{@CRLF}") $aPos = ControlGetPos($hCallersWindow, "", $hControl) $sControlID = _WinAPI_GetDlgCtrlID($hControl) If IsArray($aPos) Then ConsoleWrite("Func=[Var_GetAllWindowsControls]: ControlCounter=[" & $iTotalCounter & "] ControlID=[" & $sControlID & "] Handle=[" & $hControl & "] ClassNN=[" & $iCurrentClass & $iCurrentCount & "] XPos=[" & $aPos[0] & "] YPos=[" & $aPos[1] & "] Width=[" & $aPos[2] & "] Height=[" & $aPos[3] & "] Text=[" & $text & "]." & @CRLF) EndIf If Not WinExists($hCallersWindow) Then ExitLoop $iTotalCounter += 1 Next EndFunc ;==>Var_GetAllWindowsControls Edited June 25, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Qvintus Posted June 25, 2013 Author Posted June 25, 2013 (edited) try this out, you might get lucky: expandcollapse popup#include <Array.au3> #include <constants.au3> #include <WinAPI.au3> $hwnd = WinGetHandle("[CLASS:TV_ControlWin]") If IsHWnd($hwnd) Then Var_GetAllWindowsControls($hwnd) Else MsgBox(1,1,"can't find your window...try again with correct class") EndIf Exit Func Var_GetAllWindowsControls($hCallersWindow) ;~ $giSubFunctionCounter += 1 ; Get all list of controls $sClassList = WinGetClassList($hCallersWindow) ; Create array $aClassList = StringSplit($sClassList, @CRLF, 2) ; Sort array _ArraySort($aClassList) _ArrayDelete($aClassList, 0) ; Loop $iCurrentClass = "" $iCurrentCount = 1 $iTotalCounter = 1 For $i = 0 To UBound($aClassList) - 1 If $aClassList[$i] = $iCurrentClass Then $iCurrentCount += 1 Else $iCurrentClass = $aClassList[$i] $iCurrentCount = 1 EndIf $hControl = ControlGetHandle($hCallersWindow, "", "[CLASSNN:" & $iCurrentClass & $iCurrentCount & "]") $text = StringRegExpReplace(ControlGetText($hCallersWindow, "", $hControl), "[\n\r]", "{@CRLF}") $aPos = ControlGetPos($hCallersWindow, "", $hControl) $sControlID = _WinAPI_GetDlgCtrlID($hControl) If IsArray($aPos) Then ConsoleWrite("Func=[Var_GetAllWindowsControls]: ControlCounter=[" & $iTotalCounter & "] ControlID=[" & $sControlID & "] Handle=[" & $hControl & "] ClassNN=[" & $iCurrentClass & $iCurrentCount & "] XPos=[" & $aPos[0] & "] YPos=[" & $aPos[1] & "] Width=[" & $aPos[2] & "] Height=[" & $aPos[3] & "] Text=[" & $text & "]." & @CRLF) EndIf If Not WinExists($hCallersWindow) Then ExitLoop $iTotalCounter += 1 Next EndFunc ;==>Var_GetAllWindowsControls Sadly no info I didn't have already I appreciate your help greatly though, you've given me a great amount of ideas in getting info for future projects ^^ Anything else is welcome ofc! xD Edit: Info I got out of it even though I doubt it will provide any useful info Func=[Var_GetAllWindowsControls]: ControlCounter=[1] ControlID=[888] Handle=[0x003148E6] ClassNN=[ATL:01D1C6A81] XPos=[30] YPos=[91] Width=[0] Height=[0] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[2] ControlID=[68902512] Handle=[0x00661750] ClassNN=[ATL:01D376501] XPos=[30] YPos=[516] Width=[245] Height=[183] Text=[Please wait...]. Func=[Var_GetAllWindowsControls]: ControlCounter=[3] ControlID=[68902152] Handle=[0x002E25C8] ClassNN=[ATL:01D376502] XPos=[270] YPos=[866] Width=[180] Height=[135] Text=[Please wait...]. Func=[Var_GetAllWindowsControls]: ControlCounter=[4] ControlID=[187730544] Handle=[0x002827CA] ClassNN=[ATL:01D39E501] XPos=[30] YPos=[516] Width=[245] Height=[183] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[5] ControlID=[187730256] Handle=[0x001726A8] ClassNN=[ATL:01D39E502] XPos=[269] YPos=[865] Width=[182] Height=[165] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[6] ControlID=[126409848] Handle=[0x00242594] ClassNN=[ATL:01D3FBF81] XPos=[30] YPos=[291] Width=[245] Height=[153] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[7] ControlID=[10] Handle=[0x0035280A] ClassNN=[Edit1] XPos=[113] YPos=[124] Width=[162] Height=[20] Text=[m65-284-087]. Func=[Var_GetAllWindowsControls]: ControlCounter=[8] ControlID=[11] Handle=[0x002F2432] ClassNN=[Edit2] XPos=[30] YPos=[91] Width=[0] Height=[0] Text=[Password]. Func=[Var_GetAllWindowsControls]: ControlCounter=[9] ControlID=[666] Handle=[0x002C2722] ClassNN=[Static1] XPos=[30] YPos=[516] Width=[245] Height=[183] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[10] ControlID=[69337900] Handle=[0x00281D98] ClassNN=[TVScrollWin1] XPos=[30] YPos=[152] Width=[245] Height=[19] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[11] ControlID=[129859248] Handle=[0x00172342] ClassNN=[TVScrollWin2] XPos=[30] YPos=[516] Width=[245] Height=[183] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[12] ControlID=[129858080] Handle=[0x00670E4C] ClassNN=[TVScrollWin3] XPos=[30] YPos=[861] Width=[660] Height=[135] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[13] ControlID=[129858664] Handle=[0x009223AA] ClassNN=[TVScrollWin4] XPos=[30] YPos=[516] Width=[660] Height=[456] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[14] ControlID=[69337060] Handle=[0x005125B2] ClassNN=[TVWidget1] XPos=[30] YPos=[91] Width=[245] Height=[110] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[15] ControlID=[126498868] Handle=[0x001B286A] ClassNN=[TVWidget2] XPos=[30] YPos=[201] Width=[245] Height=[24] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[16] ControlID=[126409204] Handle=[0x001D494A] ClassNN=[TVWidget3] XPos=[30] YPos=[225] Width=[245] Height=[219] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[17] ControlID=[126435828] Handle=[0x002E27DE] ClassNN=[TVWidget4] XPos=[30] YPos=[444] Width=[245] Height=[24] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[18] ControlID=[126511260] Handle=[0x002122BC] ClassNN=[TVWidget5] XPos=[30] YPos=[468] Width=[245] Height=[24] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[19] ControlID=[126523052] Handle=[0x00211AF4] ClassNN=[TVWidget6] XPos=[30] YPos=[492] Width=[245] Height=[24] Text=[]. Func=[Var_GetAllWindowsControls]: ControlCounter=[20] ControlID=[127766740] Handle=[0x0051076C] ClassNN=[TVWidget7] XPos=[30] YPos=[516] Width=[245] Height=[24] Text=[]. Edited June 25, 2013 by Qvintus
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