MZXPTLK Posted October 24, 2008 Share Posted October 24, 2008 Hi, I want to control a treeview (SysTreeView32) of a third party product with AutoIt. In the treeview a node should be selected an expanded. Any ideas? Manfred Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 24, 2008 Share Posted October 24, 2008 Helpfile, that's why it's there. Look at the Control* functions. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
MZXPTLK Posted October 24, 2008 Author Share Posted October 24, 2008 Helpfile, that's why it's there. Look at the Control* functions.Good idea, but I only found things about controlling treeviews that are created with AutoIt's TreeViewItemControl ... Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 24, 2008 Share Posted October 24, 2008 Did you look at the Control* functions? ControlClick, ControlSend() etc. Use the Window Info Tool to find out the details about the treeview and you should be good from there. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
MZXPTLK Posted October 24, 2008 Author Share Posted October 24, 2008 Did you look at the Control* functions? ControlClick, ControlSend() etc. Use the Window Info Tool to find out the details about the treeview and you should be good from there.Yes, I know this functions.But I want to get control over the treeview and its nodes, and not only use sendkeys.There is a DLL called AutoItTreeViewExtension.dll, to use for that.But I didnot get it to work, and thought there are other possibilities of controlling a treeview. Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 24, 2008 Share Posted October 24, 2008 I wouldn't know why it would matter what way you control it but to each his own. I think this was asked a while back (maybe a week or two) so a good search should turn up some results. Why don't you post the code you tried with the dll and maybe someone can help you fix it. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
MZXPTLK Posted October 24, 2008 Author Share Posted October 24, 2008 I wouldn't know why it would matter what way you control it but to each his own.Ok, let me tell you what I want to do:There is a computer administration program called 'Hyena'.Hyena shows a list of computer names (hundreds) in a treeview control.Now I have another program that gives me a computer name maybe 'PC100'.So, what I want to do, is to jump to Hyena, find the computer name 'PC100' in the treeview, select the its node and expand it.I don't think you can manage this using ControlClick and ControlSend.Maybe I'm wrong, but I'm always open for good suggestions Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 24, 2008 Share Posted October 24, 2008 Hm, I haven't personally tried this but could you possibly get the text of the node and click that way? I don't really work with treeviews much so I'm just theorizing here. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
MZXPTLK Posted October 24, 2008 Author Share Posted October 24, 2008 Hm, I haven't personally tried this but could you possibly get the text of the node and click that way? I don't really work with treeviews much so I'm just theorizing here.Thank you for the moment, i will test that ...Maybe there are more ideas? Link to comment Share on other sites More sharing options...
dbzfanatic Posted October 24, 2008 Share Posted October 24, 2008 Only other thing I could really think of is basically the same, just get the PC name however you do it and use that as the text parameter in ControlClick() so that it should open the node. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
MZXPTLK Posted October 25, 2008 Author Share Posted October 25, 2008 I found the solution. It's easy: #include <GuiTreeView.au3> There are all necessary functions I need. Manfred Link to comment Share on other sites More sharing options...
Zedna Posted October 25, 2008 Share Posted October 25, 2008 I found the solution.It's easy: #include <GuiTreeView.au3>There are all necessary functions I need.ManfredYes you are right - that's the right solution.For simple treeview operations (even in external applications) you can use also ControlTreeView() Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Varian Posted October 26, 2008 Share Posted October 26, 2008 I was able to get Hyena to navigate with the following code: I haven't been able to get the right-click menu selection to work yet. Let me know if this helps #include <GuiTreeView.au3> WinWait('Hyena v7.3','') If Not WinActive('Hyena v7.3','') Then WinActivate('Hyena v7.3','') WinWaitActive('Hyena v7.3','') $hTreeView = ControlGetHandle('Hyena v7.3', '', 'SysTreeView321') $NavigationList = StringSplit('Enterprise,Networks,Microsoft Windows Network,VarianStyles', ',') ;Expand the Tree to your Domain For $i = 1 to $NavigationList[0] Navigate($hTreeView, $NavigationList[$i]) Next Navigate($hTreeView, 'MAIL') ;Now navigate to the computer that your other program gives you ;Now do something on that computer...Get User Rights $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, 'User Rights') If $hItemFound Then _GUICtrlTreeView_ClickItem($hTreeView, $hItemFound, 'left', True, 2) Else Exit EndIf Func Navigate($Handle, $Control) $hItemFound = _GUICtrlTreeView_FindItem($Handle, $Control) If $hItemFound Then _GUICtrlTreeView_Expand($Handle, $hItemFound, True) _GUICtrlTreeView_ClickItem($Handle, $hItemFound, 'left', True, 1) Else msgbox(0, 'Error', 'Cannot Find ' & $Control) EndIf EndFunc Link to comment Share on other sites More sharing options...
MZXPTLK Posted October 28, 2008 Author Share Posted October 28, 2008 I was able to get Hyena to navigate with the following code:I haven't been able to get the right-click menu selection to work yet.Let me know if this helpsSorry for answering late ...First, thank you very much for your efforts.I tested the code, but I could only access nodes that are visible.That works indead.But, if a node is not visible, then _GUICtrlTreeView_FindItem return 0.I tried to use _GUICtrlTreeView_EnsureVisible, but without success.Perhaps you have an idea, Varian? 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