SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jan 2002
    Location
    Des Moines, Iowa
    Posts
    289
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool Code. Function to return a window handle

    I had to develop this because the developers created this really cool Java Applet that is very dynamic. I am only interested in a few known controls on the applet but the parent child structure of the objects on the applet change faster than the weather here in Iowa. I had to abandon the use of the declaration file because of this. I know the class and tag of each object that I am after but I don't know where I will find the object on the page at any given time.

    I just thought I would share it with you all. Those that want to use it, be my guest. Those that see improvements on it I would like to hear that as well.


    ------------------


    [This message has been edited by blacst (edited 07-18-2002).]

    [This message has been edited by blacst (edited 07-18-2002).]

    [This message has been edited by blacst (edited 07-18-2002).]

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Posts
    27
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cool Code. Function to return a window handle

    How do you call this function from testcase?

    ------------------

  3. #3
    Member
    Join Date
    Sep 2002
    Location
    Foster City, CA, USA
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cool Code. Function to return a window handle

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR><HR></BLOCKQUOTE>

    I don't know about using the same iCtr++ in both the inner and outer loops. What if the inner iCtr++ for child wins goes to 5, and your outer iCtr++ should go to next upper window, window 2? But your variable already looped to 5. So the outer loop, iCtr++, would be 6 instead of 2. Should you be using 2 separate counters? Has this script been tested? Maybe I am not getting it.

  4. #4
    Member
    Join Date
    Sep 2002
    Location
    Foster City, CA, USA
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cool Code. Function to return a window handle

    Sorry about the above, I didn't know how to use the quote thing. So here once more...


    [-] while listcount(lwChildWins[iCtr].GetChildren (TRUE,TRUE)) != 0 //While I have more children under this window [ ] lwChildWins2 = lwChildWins[iCtr].GetChildren (TRUE,TRUE) //Add those children to a temp list [-] for each w in lwChildWins2 [ ] listappend (lwChildWins,w) //Move those children to the permanent list [ ] iCtr++ //Move to the next child. [ ] iCtr++

    I don't know about using the same iCtr++ in both the inner and outer loops. What if the inner iCtr++ for child wins goes to 5, and your outer iCtr++ should go to next upper window, window 2? But your variable already looped to 5. So the outer loop, iCtr++, would be 6 instead of 2. Should you be using 2 separate counters? Has this script been tested? Maybe I am not getting it.

  5. #5
    Member
    Join Date
    Sep 2002
    Location
    Foster City, CA, USA
    Posts
    55
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cool Code. Function to return a window handle

    Sorry again. Anyway, what bothers me are the same counter, iCtr++, being used in the inner while and outer while in the middle of the script.

  6. #6
    Member
    Join Date
    Jun 2001
    Location
    Bedford, MA, USA
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cool Code. Function to return a window handle

    Here's a simpler mechanism to collect the child window handles (instead of the while loop).

    code:
    --------------------------------------------------------------------------------

    long iListSize = ListCount(lwChildWins) // Prime the list size keeper

    for iCtr = 1 to iListSize // Loop until all window handles collected
    ListMerge(lwChildWins,lwChildWins[iCtr].GetChildren (TRUE,TRUE)) // Append list with this child's children
    iListSize = ListCount(lwChildWins) // Get new list size
    --------------------------------------------------------------------------------


    ------------------

  7. #7
    Member
    Join Date
    Jun 2001
    Location
    Bedford, MA, USA
    Posts
    85
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Cool Code. Function to return a window handle

    For some reason, the indentations did not come through in the above code sample. The last two lines are in the for loop.
    - Jim

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:20 PM.

Copyright BetaSoft Inc.