lainline Posted January 27, 2010 Posted January 27, 2010 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
Moderators Melba23 Posted January 27, 2010 Moderators Posted January 27, 2010 lainline, Welcome to the AutoIt forum. 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. Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
lainline Posted January 27, 2010 Author Posted January 27, 2010 (edited) get text for Program tooltip example: wordpad.exe or iexplore.exeit work in tabletop all rightbut the mouse move to wordpad.exe windowscript 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 January 27, 2010 by lainline
Moderators Melba23 Posted January 28, 2010 Moderators Posted January 28, 2010 lainline,It becomes a bit more complicated if you want to read the tips of another application. Take a look at this:expandcollapse popup#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 EndFuncYou 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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
jimmi123 Posted February 3, 2010 Posted February 3, 2010 thank you learingFor Melba23Excuse 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.
lainline Posted February 3, 2010 Author Posted February 3, 2010 expandcollapse popup#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
Moderators Melba23 Posted February 3, 2010 Moderators Posted February 3, 2010 jimmi123,First, welcome to the AutoIt forum. 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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
jimmi123 Posted February 3, 2010 Posted February 3, 2010 jimmi123,First, welcome to the AutoIt forum. .... 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. M23Melba,Unfortunately (for me) your explanation are too clear now.Tank you Jimmi
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