Jump to content
Sign in to follow this  
Akashrai

Tree View Node Selection

Recommended Posts

Akashrai

I have an application with tree view. Description is following of treeview

root

chield1

chield1.1

chield1.2

........

chield2

chield2.1

chield2.2

........

so on 

 

when i click on root the tree expands and shows only chield1, chield2(not showing 3rd level) and when i click on chield1 it shows plus mark(+) before chield1 and also shows  chield1.1, chield1.2.For this i have written following code

$idTreeView = ControlGetHandle("retrival window","","[CLASSNN:WindowsForms10.SysTreeView32.app.0.141b42a_r16_ad11]")

$hItemFound = _GUICtrlTreeView_FindItemEx($idTreeView, "root|chield1")
_GUICtrlTreeView_ClickItem($idTreeView, $hItemFound, "left", False)
$hItemm = _GUICtrlTreeView_FindItemEx($idTreeView, "root|chield1|chield1.2")     ; Till here there no problem
_GUICtrlTreeView_ClickItem($idTreeView, $hItemm, "left", False,1) 

 

Now problem is in last line it not selecting the node (chield1.1). It opens enternet explorer i do not know why"?

I have checked ($hItemm) the handle is of right node(root|chield1|chield1.2)

 

Please help

 

 

 

Share this post


Link to post
Share on other sites
spudw2k

There's not a whole lot to go by in your description, so I'm going to make some assumptions.  Does clicking the item manually trigger IE? I see nothing in your post that would indicate any tie in to IE which is why I ask.  

Instead of using the _ClickItem function which triggers a "click" notification/message on the TreeView control, try using _GUICtrlTreeView_SelectItemByIndex() instead.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • DynamicRookie
      By DynamicRookie
      Hey There!
       
      So, what i need to do is an app that can read text in a image (I.e. a png that has text saying "This is a png" and return the text to a variable)
      I'm pretty much a newbie on AutoIt, my purpose is doing that but i don't know any function that can

      Any help is much appreciated
    • santoshM
      By santoshM
      How can i exit from a procedure in auto
      Func test() if x=o then     return endif endFunc  
    • Valnurat
      By Valnurat
      Hi
      Small question.
      I trying to find all index in an array with value higher than 7.
      How can that be possible?
    • TrashBoat
      By TrashBoat
      Could someone help me create or give an idea of how to do a incrementing for loop that would do this: https://i.imgur.com/YFUt47H.gifv
      I'm having a hard time figuring it out :S
    • msd1994
      By msd1994
      I have a script that just adds some keyboard shortcuts for things like displaying the current song and artist, moving the window to the side so it won't pop up in my way, and play/pause, next song, previous song (these are the only 3 to still work since they don't need the window handle.)
      In some update recently, Spotify's window class swapped from "[CLASS:SpotifyMainWindow]" to "[CLASS:Chrome_WidgetWin_0]". Using the new class in my controls doesn't seem to work, I've tried getting the window handle from the process handle (_GetHwndFromPID($PID)) but that seems to fail as well.
      Does anybody have some idea of a way I could get this script working again?
       
      edit: seems like discord has the same window class name, so could be some issue with this? Still not sure of a way to solve the issue though, I added a function to get the handle of the active window and can just use that now, but it was able to find it on its own before on spotify startup or script startup which would be preferred.
       
      Thanks!
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.