Hi All,
I am scripting an application call Baygenie pro, which is basically an ebay 
auction sniping tool available from 
http://www.snapfiles.com/php/sfdwnld.php?id=111004&a=7134512&loc=2 This 
application has a treeview, which is not a custom control, it's window type is 
22 and it's class name SysTreeView32. However this treeview does not work as 
expected. All treeview item text is spoken until you want information on the 
actual auctions. No information on the auctions is available from the treeview 
itself, this is displayed in a grid, and is only available when a treeview item 
is selected, the information disappears or is changed as soon as you cursor to 
another item in the treeview. I wrote a small ap which when a hot key is 
pressed and any node in this particuloar treview is selected window-eyes will 
tell me how many items if any are selected in the grid. Example: if you were 
bidding on two items and the treeview was focused and you cursored down to 
bidding
 and pressed the hotkey, window-eyes will search the grid, count the ebay item 
numbers, and say two. Two problems with this aproach, one, When the hotkey is 
pressed, and I quickly arrow down to the next note in the treeview, window-eyes 
does not speak the node text straight away. there is a delay of about 1 second 
then everything is back to normal again. I can then cursor through the nodes 
and the node text is spoken again. Second I want this information to be spoken 
automatically as I cursor up and down the treeview. Just how many items for now 
will do. once I can see how it's done I'll be able to add more functionality. 
Sorry if this seems to be a lengthy e-mail, I am trying to be as detailed as 
possible.
Now follows my ap which tells me how many items are available in the grid at 
the press of a hotkey.

Begin VBScript
Dim MyHotkey
Set MyHotkey = Keyboard.RegisterHotkey("Control-Shift-Windows-h", "LaunchApp")
Sub LaunchApp()
CountItems
End Sub
Function CountItems()
Dim Grid, Matches, objRegExp
Grid = ActiveWindow.Children(19).Clips.Clipstext
Set objRegExp = New RegExp
objRegExp.Global = True
objRegExp.Pattern = "\d{12}"
Set Matches = objRegExp.Execute(Grid)
If Matches.Count > 0 Then
Speak Matches.Count
Else
X = 0
Speak X
End If
End Function


I added the following routine to my main ap to try and get the above function 
to work automatically, it didn't work.

Begin VBScript
Dim TView
ActiveWinObj.Item(14).Focus 'tree view
Set TView = FocusedWindow.Parent.Control(59648).TopLevel
Sleep 200
If TView(1).Children.Item(1).Selected Then 
CountItems
End If

Hope someone can shed some light on this.
Warm Regards.
Martin Webster


Reply via email to