lewcamino Posted September 11, 2005 Share Posted September 11, 2005 Is there a way to capture the text from a tray tip? What I would like to do is take the tray tip that pops up when you get a phone call while using your computer as a bluetooth headset and lookup the number in the tray tip in Outlook and display Contact name instead of just the phone number. ANY ideas would be greatly appreciated. Thanx; Lew Link to comment Share on other sites More sharing options...
peethebee Posted September 11, 2005 Share Posted September 11, 2005 (edited) Hi! Welcome to the forums! That's not easy, I think. There are some OCR scripts availible here, but that's the last exit cause they are not that fast (at least mine *g*). You could try to click on the TrayTip in order to see if another window comes up that, where you can grab the text easily from. peethebee Edited September 11, 2005 by peethebee vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Link to comment Share on other sites More sharing options...
LxP Posted September 11, 2005 Share Posted September 11, 2005 Welcome to the forums! TrayTips are just windows. AutoIt can detect and read from Windows, therefore there should be a way to get this done. Unfortunately it seems rather difficult to get meaningful information into AutoIt Window Info about a TrayTip because when you click it to get focus (and therefore the attention of Window Info) it disappears! If someone can grab the class name of a TrayTip then it might be easier to glean more information from it. Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted September 11, 2005 Share Posted September 11, 2005 (edited) Press CTRL-ALT-F to pause the display. >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Test Class: tooltips_class32 Size: X: 0 Y: 0 W: 27 H: 17 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 11 Y: 10 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0x0066CC Dec: 26316 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: Control ID: ClassNameNN: Text: So just search for the class tooltips_class32. And save the Title as the text you are looking for. -CMR Edited September 11, 2005 by CodeMaster Rapture Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted September 11, 2005 Share Posted September 11, 2005 (edited) Well it seems my idea isn't as easy to do as I thought. Here's the code I'm using to test it: AutoItSetOption("WinTitleMatchMode",4) HotKeySet("{Esc}","Quit") $exit = 0 $search_title = "classname=tooltips_class32" $WinList = WinList($search_title) MsgBox(0,"Window List","Found: " & $WinList[0][0]) While $exit = 0 If WinExists($search_title) Then $title = WinGetTitle($search_title) $text = WinGetText($search_title) $tooltip = WinGetPos($search_title) MsgBox(0,"Tooltip","Text: " & $text & @CRLF & "Title: " & $title & @CRLF & "Position: " & $tooltip[0] & ", " & $tooltip[1] & @CRLF & "Width: " & $tooltip[2] & @CRLF & "Height: " & $tooltip[3]) EndIf Sleep(1000) WEnd Func Quit() $exit = 1 EndFunc The results are odd. On my desktop, there are 28 tooltips and all of them of null titles, positions, and text. So I modified my code to try and get a list of them: $WinList = WinList($search_title) MsgBox(0,"Window List","Found: " & $WinList[0][0]) While $exit = 0 If ($WinList[0][0] > 0) Then For $loop = 0 to $WinList[0][0] Step 1 $title = $WinList[$loop][0] $handle = $WinList[$loop][1] MsgBox(0,"Window List","Title: " & $title & @CRLF & "Handle: " & $handle) Next EndIf Sleep(10000) WEnd I get 28 unique handles, but no titles for any of them. And searching for tray tips returns the whole tray (start button, apps, time, etc), not the actual tray tip. Maybe I'm going about it wrong. -CMR Edited September 11, 2005 by CodeMaster Rapture 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