SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
screen scraping

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
screen scraping
Author Message
DLUTER



Joined: 16 Mar 2007
Posts: 44
Country: United States

Post screen scraping Reply with quote
Is there a native way in 24x7 to scrape information from a windows screen? I've got to pull information from an application that posts information onto the label of a child form.

Thanks
Mon Oct 29, 2007 6:43 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
Sure. WindowCapture, ScreenCapture, etc...

If you need text, you can use WindowGetTitle and similar. You cal also use Call statement to execute Windows API functions and send messages to edit control and get their text
Mon Oct 29, 2007 8:05 pm View user's profile Send private message
DLUTER



Joined: 16 Mar 2007
Posts: 44
Country: United States

Post Reply with quote
Thanks, thats put me in I think the right direction. The screen capture won't give us the info we want.

Here is the script i've created:

dim vExe, string "Executable here"
dim vPath, string "Path here"
dim vProc, number
dim vChild, number
dim vLog, string
dim vAPI, string

//Call Trace Viewer
//Run( vExe, vPath, vProc )
//WAIT( 15 )
//SendKeys( "{Alt}V {DOWN} {DOWN} {DOWN} {ENTER}" )


//Get Info from Thread Count window
WindowFind( "Thread Counter", vProc )
WindowGetChild( vProc, vChild )
WindowGetTitle( vChild, vLog )
WindowGetNext( vProc, vChild )
WindowGetTitle( vChild, vLog )
WindowGetNext( vProc, vChild )
WindowGetTitle( vChild, vLog )
WindowGetNext( vProc, vChild )
WindowGetTitle( vChild, vLog )
WindowGetNext( vProc, vChild )
WindowGetTitle( vChild, vLog )


Now, in the help file it states that I can use WindowGetNext to obtain "handles of other child windows for the same parent window". I try this but it dosen't get me what i'm looking for. Below is from MS SPY++ showing me my window handles for the app i'm looking for. When I use WindowGetChild I go to the first child window (Window 008904FC "&Count" Button) as I'm supposed to; then when I follow it with a WindowGetNext I go down to the next window of the app (Window 00D905B0 "" tooltips_class32). What I need to do is to scroll down and collect the information from the 8th and 9th child window (Window 007B0408 "0" Static, Window 00E6043C "" ListBox) and send that off in an email (in text format). Any ideas? As always thanks for your time.

** Parent windows are in BOLD child windows are listed underneath of them **
Window 02EE03AC "Thread Counter" #32770 (Dialog)
Window 008904FC "&Count" Button
Window 00F30520 "Close" Button
Window 00DE048E "" Edit
Window 00A104A8 "&Matching text:" Static
Window 00C30484 "&Thread count:" Static
Window 00C90524 "Match case" Button
Window 00DE04A4 "Match whole word only" Button
Window 007B0408 "0" Static **I need the information from this child window**
Window 00E6043C "" ListBox **I need the information from this child window**
Window 006A053E "&After current line only" Button
Window 017804FE "Goto First" Button
Window 006D04E0 "Goto Last" Button
Window 00D905B0 "" tooltips_class32
Window 008A05EA "Current Trace Data NOT AVAILABLE" Afx:400000:b:10011:6:bd0df7
Tue Oct 30, 2007 4:21 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7949

Post Reply with quote
This is getting interesting...
Note that WindowGetNext returns next window relative to the specified one. It looks like you are trying to call passing the parent for the first argument.

The pasted output doesn't show if all these controls are sitting on the same level. Let me guess that all these Count, Close, Goto First and other buttons and labels and edit controls belong to the Thread Counter dialog and all are next to each other.

In this case, if you find the dialog by its caption, you can use WindowGetChild(vProc , vChild) to get the Count button. From there you can call WindowGetNext( vChild, vChild) to move from Count to Close button; next WindowGetNext( vChild, vChild) call will give you the Edit field, and so on, after 7 calls, you are going to get the first required control. Since it is a static label, you can use WindowGetTitle to get the text of it. For the list box, WindowGetTitle likely will not work, as you need the selected item, not the text. Unless it is a drop-down list box. Otherwise, you would need to use Windows API to enumerate items in the list box, get their text and find the current index. Knowing the index, you can get the text of an item. Not going to be easy, but doable. If Spy++ can do it, you can do it too.
Tue Oct 30, 2007 4:40 pm View user's profile Send private message
DLUTER



Joined: 16 Mar 2007
Posts: 44
Country: United States

Post Reply with quote
That was it, thanks. I didn't even think about calling child window after child window. As a side note, you were right about the list box as well (lucky for me this info was "icing on the cake" for the user and not a requirement). It didn't grab anything from it.


Thanks again
David
Tue Oct 30, 2007 5:12 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.