GHOSTSKIKDA Posted October 2, 2014 Share Posted October 2, 2014 (edited) Welcome, I want to get classname CommandButton in VB6, with 'AutoIt v3 Window info'. TEST.rar Edited October 2, 2014 by GHOSTSKIKDA [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted October 3, 2014 Author Share Posted October 3, 2014 [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
BrewManNH Posted October 3, 2014 Share Posted October 3, 2014 Go >here and try that software. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted October 3, 2014 Author Share Posted October 3, 2014 Okey BrewManNH [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted October 3, 2014 Author Share Posted October 3, 2014 (edited) I used this Code : expandcollapse popup#include "CUIAutomation2.au3" Opt( "MustDeclareVars", 1 ) Global $oUIAutomation MainFunc() Func MainFunc() Local $hWindow = WinGetHandle("Form1") ;("[CLASS:ThunderRT6FormDC]" ) If Not $hWindow Then Return $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return Local $pWindow ;$oUIAutomation.GetRootElement( $pWindow ) ; Desktop $oUIAutomation.ElementFromHandle( $hWindow, $pWindow ) ; Window If Not $pWindow Then Return Local $oWindow = ObjCreateInterface( $pWindow, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oWindow ) Then Return ;ListDescendants( $oWindow, 0, 1 ) ; Desktop ListDescendants( $oWindow, 0, 0 ) ; Window EndFunc Func ListDescendants( $oParent, $iLevel, $iLevels = 0 ) If Not IsObj( $oParent ) Then Return If $iLevels And $iLevel = $iLevels Then Return Local $pRawWalker, $oRawWalker $oUIAutomation.RawViewWalker( $pRawWalker ) $oRawWalker = ObjCreateInterface( $pRawWalker, $sIID_IUIAutomationTreeWalker, $dtagIUIAutomationTreeWalker ) Local $pUIElement, $oUIElement $oRawWalker.GetFirstChildElement( $oParent, $pUIElement ) $oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) Local $sIndent = "" For $i = 0 To $iLevel - 1 $sIndent &= " " Next While IsObj( $oUIElement ) ConsoleWrite( $sIndent & "Title = " & _UIA_getPropertyValue( $oUIElement, $UIA_NamePropertyId ) & @CRLF & _ $sIndent & "Class = " & _UIA_getPropertyValue( $oUIElement, $UIA_ClassNamePropertyId ) & @CRLF & _ $sIndent & "Ctrl type = " & _UIA_getPropertyValue( $oUIElement, $UIA_ControlTypePropertyId ) & @CRLF & _ $sIndent & "Ctrl name = " & _UIA_getPropertyValue( $oUIElement, $UIA_LocalizedControlTypePropertyId ) & @CRLF & _ $sIndent & "Selected = " & _UIA_getPropertyValue( $oUIElement, $UIA_SelectionItemIsSelectedPropertyId ) & @CRLF & _ $sIndent & "Handle = " & Hex( _UIA_getPropertyValue( $oUIElement, $UIA_NativeWindowHandlePropertyId ) ) & @CRLF & @CRLF ) ListDescendants( $oUIElement, $iLevel + 1, $iLevels ) $oRawWalker.GetNextSiblingElement( $oUIElement, $pUIElement ) $oUIElement = ObjCreateInterface( $pUIElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) WEnd EndFunc Func _UIA_getPropertyValue( $obj, $id ) Local $tVal $obj.GetCurrentPropertyValue( $id, $tVal ) If Not IsArray( $tVal ) Then Return $tVal Local $tStr = $tVal[0] For $i = 1 To UBound( $tVal ) - 1 $tStr &= "; " & $tVal[$i] Next Return $tStr EndFunc Result : expandcollapse popupTitle = Command1 Class = ThunderRT6CommandButton Ctrl type = 50000 Ctrl name = Bouton Selected = False Handle = 01570602 Title = Class = ThunderRT6TextBox Ctrl type = 50004 Ctrl name = Modifier Selected = False Handle = 0023064C Title = Class = Ctrl type = 50037 Ctrl name = barre de titre Selected = False Handle = 00000000 Title = Système Class = Ctrl type = 50010 Ctrl name = barre de menus Selected = False Handle = 00000000 Title = Système Class = Ctrl type = 50011 Ctrl name = élément de menu Selected = False Handle = 00000000 Title = Réduire Class = Ctrl type = 50000 Ctrl name = Bouton Selected = False Handle = 00000000 Title = Agrandir Class = Ctrl type = 50000 Ctrl name = Bouton Selected = False Handle = 00000000 Title = Fermer Class = Ctrl type = 50000 Ctrl name = Bouton Selected = False Handle = 00000000 But there is no get classname commandButton http://support2.microsoft.com/kb/224305/en-us Edited October 3, 2014 by GHOSTSKIKDA [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
EKY32 Posted October 3, 2014 Share Posted October 3, 2014 (edited) There is a lovely tool called "RanorexSpy", try it. Here is a free copy of the old version attached, I hope it helps, master. RanorexSpy.zip Edited October 3, 2014 by EKY32 [font="'trebuchet ms', helvetica, sans-serif;"]Please mark the answer of your question if you found it.[/font] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted October 7, 2014 Author Share Posted October 7, 2014 Thank you brother Rami, but also did not succeed [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted October 9, 2014 Author Share Posted October 9, 2014 [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted October 12, 2014 Author Share Posted October 12, 2014 No convincing answer [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted January 6, 2015 Author Share Posted January 6, 2015 [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
GHOSTSKIKDA Posted March 6, 2016 Author Share Posted March 6, 2016 up [center]I LOVE ALGERIA .... ;-)[/center] Link to comment Share on other sites More sharing options...
Developers Jos Posted March 6, 2016 Developers Share Posted March 6, 2016 Guess we can expect the next bump in 2 months again? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
LarsJ Posted March 7, 2016 Share Posted March 7, 2016 Isn't "ThunderRT6CommandButton" (post 5, second line in Result box) the class name of the button? Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
LarsJ Posted March 7, 2016 Share Posted March 7, 2016 Jos, Shouldn't it be 1 year and 2 months? One can hardly blame the OP for being impatient. I have downloaded TEST.rar and executed TEST.exe on my old XP. Now I understand. The Form1 GUI contains two buttons, two textboxes, a title bar, a system menu and the usual minimize, maximize and close buttons. All controls except one textbox and one button are recognized by the code in post 4 (I can see, that's my code). And the question by the OP seems to be: Why is one textbox and one button not recognized? Because the programmer of the Form1 GUI has not added any code to the controls, that makes it possible to recognize the controls. The only controls which can be recognized automatically for example by the "AutoIt Window Info" tool are the standard MicroSoft controls in ComCtl32.dll. The controls in Form1 are not standard controls but Microsoft Forms 2.0 Controls. To be able to recognized such controls the programmer of the Form1 GUI must add code to the controls, that makes it possible to recognize the controls. He has not done, and the controls can not be recognized. I've also tested with Inspect.exe from Windows SDK. It also does not recognize the controls at all. Neither in UI Automation mode nor in Accessibility mode. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
Developers Jos Posted March 7, 2016 Developers Share Posted March 7, 2016 18 minutes ago, LarsJ said: Jos, Shouldn't it be 1 year and 2 months? One can hardly blame the OP for being impatient. Yea you are right SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
junkew Posted March 8, 2016 Share Posted March 8, 2016 Interesting analysis. Advice to OP to download trial version of testcomplete to see if that commercial tool is seeing more. For microsoft uiautomation team it could be logged as a defect not recognizing their own ms forms controls. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
LarsJ Posted March 9, 2016 Share Posted March 9, 2016 FM20.dll seems to have been distributed with Windows 95 or Office 97. It's 20 years old. VB6 is about 20 years old. The official MicroSoft support for all this software probably stopped 10 years ago. I don't think there is any guarantee at all that TestComplete is able to recognize the controls. I don't think the UI Automation team will consider it as a defect not to be able to recognize controls created with unsupported 20 years old software. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions 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