Netol Posted August 3, 2024 Posted August 3, 2024 (edited) Hello, dear friends, I would like to ask you about the code to obtain the tip-url chrome like the attached image. The idea is work with the actual open chrome window When I hover over a section, the tooltip appears, which I left in the attached image. best regards Edited August 5, 2024 by Netol error writting
junkew Posted August 9, 2024 Posted August 9, 2024 (edited) You should basically try what is in faq 31 and 40 Edited August 9, 2024 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Netol Posted August 21, 2024 Author Posted August 21, 2024 Thank you for your reply dear, I have searched the URLs you sent me but I have not been able to find the code I need
junkew Posted September 2, 2024 Posted September 2, 2024 Did you try simplespy? Netol 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Netol Posted September 3, 2024 Author Posted September 3, 2024 Thanks for your responce. Do you have more information about simplespy best regards
junkew Posted September 3, 2024 Posted September 3, 2024 Do you have more information on how you search and learn in the forum? Netol 1 FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
Solution Danyfirex Posted September 5, 2024 Solution Posted September 5, 2024 Hello. Here is a sample. expandcollapse popup#AutoIt3Wrapper_UseX64=n ;~ #RequireAdmin #include <WinAPISysWin.au3> #include ".\UIASpy\Includes\UIA_Constants.au3" HotKeySet("{ESC}", "Quit") ;Press ESC key to quit _Test() Func Quit() Exit EndFunc ;==>Quit Func _Test() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation) If Not IsObj($oUIAutomation) Then Return ConsoleWrite("$oUIAutomation ERR" & @CRLF) ConsoleWrite("$oUIAutomation OK" & @CRLF) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oDesktop) Then Return ConsoleWrite("$oDesktop ERR" & @CRLF) ConsoleWrite("$oDesktop OK" & @CRLF) While Sleep(30) Local $hHandle = WinGetHandle("[ACTIVE]") If _WinAPI_GetClassName($hHandle) <> "Chrome_WidgetWin_1" Then ContinueLoop ConsoleWrite(WinGetTitle($hHandle) & @CRLF) Local $pCondition ; Note that $UIA_ClassNamePropertyId maybe ia a CASE SENSITIVE condition $oUIAutomation.CreatePropertyCondition($UIA_NativeWindowHandlePropertyId, Int($hHandle), $pCondition) ;hwnd need to be converted to int If Not $pCondition Then ContinueLoop ConsoleWrite("$pCondition OK") ;When searching for top-level windows on the desktop, be sure to specify TreeScope_Children in the scope parameter, not TreeScope_Descendants. ;A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow. Local $pWindow $oDesktop.FindFirst($TreeScope_Children, $pCondition, $pWindow) Local $oWindow = ObjCreateInterface($pWindow, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oWindow) Then ContinueLoop ConsoleWrite("$oWindow OK") Local $pCondition0 $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0) If Not $pCondition0 Then ContinueLoop ConsoleWrite("$pCondition0 OK" & @CRLF) Local $pPaneChrome, $oPaneChrome $oWindow.FindFirst($TreeScope_Descendants, $pCondition0, $pPaneChrome) $oPaneChrome = ObjCreateInterface($pPaneChrome, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oPaneChrome) Then ContinueLoop ConsoleWrite("$oPaneChrome OK" & @CRLF) Local $pCondition0 $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_PaneControlTypeId, $pCondition0) If Not $pCondition0 Then ContinueLoop ConsoleWrite("$pCondition0 OK" & @CRLF) Local $pPaneFirst, $oPaneFirst $oPaneChrome.FindFirst($TreeScope_Children, $pCondition0, $pPaneFirst) $oPaneFirst = ObjCreateInterface($pPaneFirst, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oPaneFirst) Then ContinueLoop ConsoleWrite("$oPaneFirst OK" & @CRLF) Local $pCondition1 $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1) If Not $pCondition1 Then ContinueLoop ConsoleWrite("$pCondition1 OK" & @CRLF) Local $pText1, $oText1 $oPaneFirst.FindFirst($TreeScope_Descendants, $pCondition1, $pText1) $oText1 = ObjCreateInterface($pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oText1) Then ContinueLoop ConsoleWrite("$oText1 OK" & @CRLF) Local $sValue = "" $oText1.GetCurrentPropertyValue($UIA_NamePropertyId, $sValue) ConsoleWrite($sValue & @CRLF) ToolTip($sValue,Default,Default,"Link") WEnd EndFunc ;==>_Test Saludos ioa747, Netol and argumentum 3 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Netol Posted September 5, 2024 Author Posted September 5, 2024 6 hours ago, Danyfirex said: Hello. Here is a sample. expandcollapse popup#AutoIt3Wrapper_UseX64=n ;~ #RequireAdmin #include <WinAPISysWin.au3> #include ".\UIASpy\Includes\UIA_Constants.au3" HotKeySet("{ESC}", "Quit") ;Press ESC key to quit _Test() Func Quit() Exit EndFunc ;==>Quit Func _Test() ; Create UI Automation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtag_IUIAutomation) If Not IsObj($oUIAutomation) Then Return ConsoleWrite("$oUIAutomation ERR" & @CRLF) ConsoleWrite("$oUIAutomation OK" & @CRLF) ; Get Desktop element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oDesktop) Then Return ConsoleWrite("$oDesktop ERR" & @CRLF) ConsoleWrite("$oDesktop OK" & @CRLF) While Sleep(30) Local $hHandle = WinGetHandle("[ACTIVE]") If _WinAPI_GetClassName($hHandle) <> "Chrome_WidgetWin_1" Then ContinueLoop ConsoleWrite(WinGetTitle($hHandle) & @CRLF) Local $pCondition ; Note that $UIA_ClassNamePropertyId maybe ia a CASE SENSITIVE condition $oUIAutomation.CreatePropertyCondition($UIA_NativeWindowHandlePropertyId, Int($hHandle), $pCondition) ;hwnd need to be converted to int If Not $pCondition Then ContinueLoop ConsoleWrite("$pCondition OK") ;When searching for top-level windows on the desktop, be sure to specify TreeScope_Children in the scope parameter, not TreeScope_Descendants. ;A search through the entire subtree of the desktop could iterate through thousands of items and lead to a stack overflow. Local $pWindow $oDesktop.FindFirst($TreeScope_Children, $pCondition, $pWindow) Local $oWindow = ObjCreateInterface($pWindow, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oWindow) Then ContinueLoop ConsoleWrite("$oWindow OK") Local $pCondition0 $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "Chrome_WidgetWin_1", $pCondition0) If Not $pCondition0 Then ContinueLoop ConsoleWrite("$pCondition0 OK" & @CRLF) Local $pPaneChrome, $oPaneChrome $oWindow.FindFirst($TreeScope_Descendants, $pCondition0, $pPaneChrome) $oPaneChrome = ObjCreateInterface($pPaneChrome, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oPaneChrome) Then ContinueLoop ConsoleWrite("$oPaneChrome OK" & @CRLF) Local $pCondition0 $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_PaneControlTypeId, $pCondition0) If Not $pCondition0 Then ContinueLoop ConsoleWrite("$pCondition0 OK" & @CRLF) Local $pPaneFirst, $oPaneFirst $oPaneChrome.FindFirst($TreeScope_Children, $pCondition0, $pPaneFirst) $oPaneFirst = ObjCreateInterface($pPaneFirst, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oPaneFirst) Then ContinueLoop ConsoleWrite("$oPaneFirst OK" & @CRLF) Local $pCondition1 $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_TextControlTypeId, $pCondition1) If Not $pCondition1 Then ContinueLoop ConsoleWrite("$pCondition1 OK" & @CRLF) Local $pText1, $oText1 $oPaneFirst.FindFirst($TreeScope_Descendants, $pCondition1, $pText1) $oText1 = ObjCreateInterface($pText1, $sIID_IUIAutomationElement, $dtag_IUIAutomationElement) If Not IsObj($oText1) Then ContinueLoop ConsoleWrite("$oText1 OK" & @CRLF) Local $sValue = "" $oText1.GetCurrentPropertyValue($UIA_NamePropertyId, $sValue) ConsoleWrite($sValue & @CRLF) ToolTip($sValue,Default,Default,"Link") WEnd EndFunc ;==>_Test Saludos Thanks a lot, this code work correctly. Best regards
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