Jump to content
Sign in to follow this  
lainline

get "tooltips_class32" word

Recommended Posts

lainline

i want get "tooltips_class32" word

but my script Just work in " Program Manager"

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 100, 100, 50, 50)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case Else

;WinWait("[CLASS:tooltips_class32]")

$text=ControlGetText("[CLASS:tooltips_class32]","","")

TrayTip("tooltipstext:",$text,0,0)

EndSwitch

WEnd

Share this post


Link to post
Share on other sites
Melba23

lainline,

Welcome to the AutoIt forum. :D

my script Just work in " Program Manager"

Where do you want it to work? You have no tooltips in your script, so what tips are you hoping to read?

M23

P.S. When you post code, please use Code tags. Put [autoit ] before and [/autoit ] after your posted code (but omit the trailing space - it is only there so the tags display here). Or you can press the blue button just under the BOLD toolbar button. :huggles:


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
lainline

get text for Program tooltip

example: wordpad.exe or iexplore.exe

it work in tabletop all right

but the mouse move to wordpad.exe window

script can not work

[/b]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 100, 100, 50, 50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case Else
;WinWait("[CLASS:tooltips_class32]")
$text=ControlGetText("[CLASS:tooltips_class32]","","")
TrayTip("tooltipstext:",$text,0,0) 
EndSwitch
WEnd 
[b]
Edited by lainline

Share this post


Link to post
Share on other sites
Melba23

lainline,

It becomes a bit more complicated if you want to read the tips of another application. Take a look at this:

#include <WindowsConstants.au3>
#include <GuiToolTip.au3>

HotKeySet("{F1}", "_Read_Tip")
HotKeySet("{ESC}", "On_Exit")

 ; Choose your app
Global $sTitle = "[CLASS:WordPadClass]"
WinWaitActive($sTitle, "", 10)
; Get PID of your app
Global $iPID = WinGetProcess($sTitle)

; Keep the script running
While 1

    Sleep(10)

WEnd

Func _Read_Tip()

    ; Get list of tooltips
    Local $aTipList = WinList("[CLASS:tooltips_class32]")
    ; See which belong to your app
    For $i = 1 To $aTipList[0][0]
        If WinGetProcess($aTipList[$i][1]) = $iPID Then
            ; See which one is active
            Local $aRet = _GUIToolTip_GetCurrentTool($aTipList[$i][1])
            ; If one is active then display it
            If $aRet[8] <> "" Then MsgBox(0, "Visible Tip", $aRet[8])
        EndIf
    Next

EndFunc

Func On_Exit()

    Exit

EndFunc

You have 10 seconds to get WordPad active after starting the script. Then every time you press F1 and there is an active Tooltip you will get a MsgBox with the text. Press ESC to exit the script.

I hope that is what you want. :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
lainline

Posted Image thank you

learing

Share this post


Link to post
Share on other sites
jimmi123

Posted Image thank you

learing

For Melba23

Excuse me Melba,

but for me it is not clear, I would learn to get the tooltip from other programs (i.e. Autocad or Word).

I have tried to change the name of application in 'sTitle' without any result.

Could you please give me further detailed information ?

Thank you in advance.

Share this post


Link to post
Share on other sites
lainline

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiToolTip.au3>
#Include <Array.au3>
#Include <GuiEdit.au3>
Global $aRet2 [1] 
#Region ### START Koda GUI section ### Form=d:\我的文档\桌面\TextCapture\chs\Form3.kxf
$Form1 = GUICreate("Form1", 442, 346, 192, 124)
$Edit1 =GUICtrlCreateEdit("", 8, 8, 137, 329)
$Edit2 =GUICtrlCreateEdit("", 152, 8, 137, 329)
$Edit3 =GUICtrlCreateEdit("", 296, 8, 137, 329)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg

  Case $GUI_EVENT_CLOSE
   Exit
  Case Else
    Sleep(10)
 _Read_Tip()
 EndSwitch
WEnd

Func _Read_Tip()

    Local $aTipList = WinList("[CLASS:tooltips_class32]")
 Local $new
 $aRet2 [0] = ("tip text:")
 $aTip = $aTipList[0][0]
 
    For $i = 1 To $aTip
            Local  $aRet= _GUIToolTip_GetCurrentTool($aTipList[$i][1])
    If Not $aRet[8]="" Then 
    If _ArrayFindAll($aRet2 ,$aRet[8]) = -1 Then 
    _ArrayAdd($aRet2, $aRet[8])
    _GUICtrlEdit_SetText($Edit1,_ArrayToString($aRet2 , @CRLF))
    EndIf
    EndIf 
  Next
EndFunc

Share this post


Link to post
Share on other sites
Melba23

jimmi123,

First, welcome to the AutoIt forum. :D

You could well have problems here because many applications do not use the standard tooltips_class32 toolbars but use their own specially drawn controls - which makes interacting with them a bit difficult. From the Help file page for WinMenuSelectItem:

"Unfortunately, many menus in use today are actually custom written or toolbars "pretending" to be menus. This is true for most Microsoft applications."

If I look at my ancient copy of Word 2000 with the AutoIt Window Info tool, I see that the toolbars are of the MsoCommandBar class and they are not identified by WinList - whch makes my script useless. :

Sorry I cannot be of more help. Perhaps next time. :huggles:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
jimmi123

jimmi123,

First, welcome to the AutoIt forum. :D

.... text snippet .........

"Unfortunately, many menus in use today are actually custom written or toolbars "pretending" to be menus. This is true for most Microsoft applications."

Sorry I cannot be of more help. Perhaps next time. :huggles:

M23

Melba,

Unfortunately (for me) your explanation are too clear now.

Tank you :

Jimmi

Share this post


Link to post
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
Sign in to follow this  

×