Jump to content

Clickable link in tooltip


caramen
 Share

Recommended Posts

Hello guys :) 

Hope you all doing well. 

 

Simple as that.... 

$SuccessText2 = $SuccessText2 & " https://xxxxxxxxxxxxxxxx/index.php?action=cons_view&consigne=49030 "

Func _Tooltip ($SuccessText)
   $MyToolTip = 1
   $SuccessText2 &= $SuccessText
   $MyToolTip = ToolTip ($SuccessText2,0,0 , "Checks results")
   $SuccessText2 = ""
EndFunc

Is it possible to make this link clickable on tool tip display ?

Or I have to make my own GUI for this ? 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Here an example :

#include <Constants.au3>
#include <WinAPISysWin.au3>
#include <Misc.au3>

$sURL = "www.google.com"

ToolTip($sURL, Default, Default, "Click on me")

Local $bClick = _ClickToolTip(5)
MsgBox ($MB_SYSTEMMODAL,"Is tool tip clicked ?", $bClick)

Func _ClickToolTip($iTimeOut)
  Local $hWnd = WinGetHandle("[CLASS:tooltips_class32]")
  If Not $hWnd Then Return False
  Local $hTimer = TimerInit()
  While TimerDiff($hTimer) < $iTimeOut*1000
    Local $tRect = _WinAPI_GetWindowRect($hWnd)
    If _IsPressed("01") Then
      Local $aPos = MouseGetPos()
      If $aPos[0] >= $tRect.left And $aPos[0] <= $tRect.right And $aPos[1] >= $tRect.top And $aPos[1] <= $tRect.bottom Then
        ToolTip("")
        Return True
      EndIf
    EndIf
  WEnd
  ToolTip("")
  Return False
EndFunc

 

Link to comment
Share on other sites

From what I understand after left mouseclick into the tooltip square before 5 seconds, it should return true. 

But anywhere I click it return false. 

I will have sometime 8 links for one result. It's not ideal for my case. I will try to work with this logic because she's nice.

But if you have another way I take ! 

No way to create a real link into tooltip then...😕

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

#include <Constants.au3>
#include <WinAPISysWin.au3>
#include <Misc.au3>
#include <Array.au3>

$sURL = "www.google.com"

$tool = ToolTip($sURL, 0, 0, "Click on me")

Local $bClick = _ClickToolTip(15)
MsgBox ($MB_SYSTEMMODAL,"Is tool tip clicked ?", $bClick)

Func _ClickToolTip($iTimeOut)
  Local $hWnd = WinGetHandle("[CLASS:tooltips_class32]")
  Local $aToolTip = WinList("[CLASS:tooltips_class32]")
  _ArrayDisplay ($aToolTip)
  MsgBox ( 64 , 0 , $aToolTip[1][1] )

  If Not $hWnd Then Return False
  Local $tRect = _WinAPI_GetWindowRect($aToolTip[1][1])
  MsgBox (64 , 0 , $tRect.left )
  MsgBox (64 , 0 , $tRect.right )
  MsgBox (64 , 0 , $tRect.top )
  MsgBox (64 , 0 , $tRect.bottom )
  
  Local $hTimer = TimerInit()
  While TimerDiff($hTimer) < $iTimeOut*1000
    If _IsPressed("01") Then
        ConsoleWrite ("RC+1"&@CRLF)
      Local $aPos = MouseGetPos()
      If $aPos[0] >= $tRect.left And $aPos[0] <= $tRect.right And $aPos[1] >= $tRect.top And $aPos[1] <= $tRect.bottom Then
        ToolTip("")
        Return True
      EndIf
    EndIf
  WEnd
  ToolTip("")
  Return False
  
EndFunc

image.thumb.png.5d2ab84e8719759e4bfa657c2e1339f5.png

Tool tip is at 0,0 

Msg box are around 1400 800 is that normal ? :huh2:

 

Also, If I use [1][15] I got subscript error :huh2: I expect the correct hwnd for me is [1] [15] but it return error. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I think I will make a transparent GUI over tool tip with buttons.

So complicated for this  😅

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Oh, ya forgot about Win10 hidden tooltips.

#include <Constants.au3>
#include <WinAPISysWin.au3>
#include <Misc.au3>
#include <Array.au3>

$sURL = "www.google.com"

ToolTip($sURL, Default, Default, "Click on me")

Local $bClick = _ClickToolTip($sURL, 5)
MsgBox ($MB_SYSTEMMODAL,"Is tool tip clicked ?", $bClick)

Func _ClickToolTip($sText, $iTimeOut)
  Local $hWnd = WinGetHandle("[TITLE:" & $sText & ";CLASS:tooltips_class32]")
  If Not $hWnd Then Return False
  Local $hTimer = TimerInit()
  While TimerDiff($hTimer) < $iTimeOut*1000
    Local $tRect = _WinAPI_GetWindowRect($hWnd)
    If _IsPressed("01") Then
      Local $aPos = MouseGetPos()
      If $aPos[0] >= $tRect.left And $aPos[0] <= $tRect.right And $aPos[1] >= $tRect.top And $aPos[1] <= $tRect.bottom Then
        ToolTip("")
        Return True
      EndIf
    EndIf
  WEnd
  ToolTip("")
  Return False
EndFunc

 

Link to comment
Share on other sites

  • 3 weeks later...

@rudi  Thanks, glad you like it.

I noticed on my Win10 machine a number (about 15) of untitled tooltips_class32 windows.  So to get the right one, I need to specify also its title.  That is not required on my Win7 box.

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