AoRaToS Posted August 23, 2008 Share Posted August 23, 2008 Like the title says. how can I delete a single TreeView child??Or do I have to redraw the treeview without that item cause that would be a stupid workaround... s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
AoRaToS Posted August 24, 2008 Author Share Posted August 24, 2008 (edited) BUMP...nobody knows if it's possible????????????? Edited August 24, 2008 by AoRaToS s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 Just a hint. One search for TreeView in the help file and what do you get on line 10, 11 and 12? It's even a nice little sample for you to try out in there. So how f** hard can it be? People spent real time to provide you with a state of the art help file but do you bother to look in it? That is showing disrespect, shame on you!Now, if the sample does not work, that's another story. but then you should let us know and post some sample code demonstrating your problem. UtenPS: I know some of the TreeView samples don't work on w2k without some simple tweaking. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AoRaToS Posted August 24, 2008 Author Share Posted August 24, 2008 I can't see anything that will delete a treeview child, only a udf tha deletes all the children,enlighten me s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 _GUICtrlTreeView_Delete: Removes an item and all its children You want to remove the item but not the children without moving them? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 This is probably more like it for you: _GUICtrlTreeView_DeleteChildren : Deletes all children of a item Line 12 as I pointed you to in my first post. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 And when I think of it. A children is an item? So _GUICtrlTreeView_Delete should work on children as an item to? Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AoRaToS Posted August 24, 2008 Author Share Posted August 24, 2008 I want to remove one single Child from an item ITEM --->child1 --->child2 How can I delete child 2? s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 Get the handle of the child and modify the helpfile sample $child = _GUICtrlTreeView_AddChild($hTreeView, $hItem, StringFormat("[%02d] New Child", $y), $iImage, $iImage) Next Next _GUICtrlTreeView_EndUpdate($hTreeView)oÝ÷ Ù«¢+Ø$$%5Í ½à ÐÄØÀ°ÅÕ½Ðí%¹½ÉµÑ¥½¸ÅÕ½Ðì°ÅÕ½Ðí±ÑÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐílÀÉt9Ü%Ñ´ÅÕ½Ðì°ÀÌØíà´Ä¤µÀìÅÕ½Ðì´´ØÈìÅÕ½ÐìµÀìMÑÉ¥¹½ÉµÐ ÅÕ½ÐílÀÉt9Ü ¡¥±ÅÕ½Ðì°ÀÌØíä´Ä¤¤($$%}U% ÑɱQÉY¥Ý}±Ñ ÀÌØí¡QÉY¥Ü°ÀÌØí¡¥± Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
Zedna Posted August 24, 2008 Share Posted August 24, 2008 I want to remove one single Child from an itemITEM--->child1--->child2How can I delete child 2?Look at:_GUICtrlTreeView_GetFirstItem_GUICtrlTreeView_GetFirstChild_GUICtrlTreeView_GetNextSibling_GUICtrlTreeView_Delete Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
BrettF Posted August 24, 2008 Share Posted August 24, 2008 OMG! RTFM mate, you're getting brilliant help, yet you ain't trying one bit! So here you go. Your answer. Plucked it ALL from in the example in the help file that Uten mentioned. Amazing aint it? #include <GUIConstants.au3> #Include <GuiTreeView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("AForm1", 183, 175, 193, 115) $hTreeView = GUICtrlCreateTreeView(8, 8, 169, 129) $parent_1 = _GUICtrlTreeView_Add($hTreeView, 0, "Parent 1") $parent_2 = _GUICtrlTreeView_Add($hTreeView, 0, "Parent 2") $child_1_1 = _GUICtrlTreeView_AddChild($hTreeView, $parent_1, "Child 1") $child_1_2 = _GUICtrlTreeView_AddChild($hTreeView, $parent_1, "Child 2") $child_1_3 = _GUICtrlTreeView_AddChild($hTreeView, $parent_1, "Child 3") $child_2_1 = _GUICtrlTreeView_AddChild($hTreeView, $parent_2, "Child 4") $child_2_2 = _GUICtrlTreeView_AddChild($hTreeView, $parent_2, "Child 4") $child_2_2_1 = _GUICtrlTreeView_AddChild($hTreeView, $child_2_2, "Child 5") $Button1 = GUICtrlCreateButton("Exit", 16, 144, 75, 25, 0) $Button2 = GUICtrlCreateButton("Delete Child 3", 96, 144, 75, 25, 0) _GUICtrlTreeView_Expand($hTreeView) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit Case $Button2 $ret = _GUICtrlTreeView_Delete ($hTreeView, $child_1_3) EndSwitch WEnd behdadsoft 1 Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
AoRaToS Posted August 24, 2008 Author Share Posted August 24, 2008 I don't think that'll work, even if it does, that's adding a child and deleting in, I want to search for achild ad delete it, how hard can it be?nothing seems to work s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
BrettF Posted August 24, 2008 Share Posted August 24, 2008 Start from the beginning. What exactly do you want to achieve. Add lots of detail and pictures. Then we can help. Cause this is going nowhere. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 I don't think that'll work, even if it does, that's adding a child and deleting in, I want to search for achild ad delete it, how hard can it be?nothing seems to workAdding new information proving that you did not look to hard in the help file does not help much. And *ROLF* Your new question is already answered aboveI'm sorry I'm just in that mood this morning.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AoRaToS Posted August 24, 2008 Author Share Posted August 24, 2008 Ok my friend, that's more like help, take a look at my script: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiTreeView.au3> #include <GuiImageList.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <TreeViewConstants.au3> #include <StaticConstants.au3> #include <String.au3> Opt("GUIOnEventMode",1) Opt("TrayMenuMode",1) TraySetIcon("Shell32.dll",16) Global $LANTree, $Online, $NETVIEW Global $PrivateIP = @IPAddress1 Global $serversocket = 0 Global $signonclientip, $contactcast, $changeaddress, $contactdata MainGUI() Contacts() ;Messenger() Func Messenger() UDPStartup() $chatserver = UDPBind($PrivateIP, 65333) TrayTip("", "LAN Talk: " & @ComputerName & "(" & $PrivateIP & ")", 5) Sleep(3000) If @error <> 0 Then TrayTip("", @error, 10) Call ("OnExit") Else While 1 $data = UDPRecv($chatserver, 5000) If $data <> "" Then MsgBox(0,"a",$data) EndIf sleep(100) WEnd EndIf EndFunc Func Contacts() ;start contact server UDPStartup() $contactserver = UDPBind($PrivateIP, 65335) TrayTip("", "LAN Talk: " & @ComputerName & "(" & $PrivateIP & ")", 5) Sleep(500) ;create multicast address $splitaddress = StringSplit($PrivateIP, ".") $changeaddress = $splitaddress[1] & "." & $splitaddress[2] & "." & $splitaddress[3] & "." & "255" ;send packet $contactcast = UDPOpen($changeaddress, 65335) UDPSend($contactcast, "SIGN-ON" & $PrivateIP & "|" & @ComputerName) UDPCloseSocket($contactcast) While 1 $contactdata = UDPRecv($contactserver, 50) If $contactdata <> "" Then If StringLeft($contactdata,7) = "SIGN-ON" Then $signonclientipname = StringMid($contactdata, 8) $signonclient = StringSplit($signonclientipname, "|") $signonclientip = $signonclient[1] $signonclientname = $signonclient[2] $signonclientid = $signonclientname & " - " & $signonclientip If $signonclientip <> $PrivateIP Then $signonsearchclient = _GUICtrlTreeView_FindItem($NETVIEW,$signonclientid) If $signonsearchclient = 0 Then GUICtrlCreateTreeViewItem($signonclientid, $NETVIEW) GUICtrlSetState($NETVIEW, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) ;Call("Clientmsg") EndIf EndIf EndIf If StringLeft($contactdata,8) = "SIGN-OFF" Then $signoffclientipname = StringMid($contactdata, 9) $signoffclient = StringSplit($signoffclientipname, "|") $signoffclientip = $signoffclient[1] $signoffclientname = $signoffclient[2] $signoffclientid = $signoffclientname & " - " & $signoffclientip MsgBox(0,".",$signoffclientid) $signoffsearchclient = _GUICtrlTreeView_FindItem($NETVIEW,$signoffclientid) If $signoffsearchclient Then MsgBox(0,".",$signoffsearchclient) _GUICtrlTreeView_Delete($NETVIEW,$signoffsearchclient) EndIf EndIf EndIf Sleep(100) WEnd EndFunc Func MainGUI() GUICreate("LAN Talk", 204, 404) $LANTree = GUICtrlCreateTreeView(2, 2, 200, 400, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS), $WS_EX_CLIENTEDGE) $NETVIEW = GUICtrlCreateTreeViewItem("Local Network", $LANTree) GUISetOnEvent($GUI_EVENT_CLOSE,"OnExit") GUICtrlSetColor(-1, 0x0000C0) GUICtrlSetState($NETVIEW, BitOR($GUI_EXPAND, $GUI_DEFBUTTON)) GUISetState() EndFunc Func OnExit() $sign_off = UDPOpen($changeaddress, 65335) UDPSend($sign_off, "SIGN-OFF" & $PrivateIP & "|" & @ComputerName) UDPCloseSocket($sign_off) GUIDelete($LANTree) Exit EndFunc While 1 Sleep(100) WEnd Check this out: _GUICtrlTreeView_Delete($NETVIEW,$signoffsearchclient) I want to delete the one that sends SIGN-OFF...I've tried allot of things :/ s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 Link to comment Share on other sites More sharing options...
Uten Posted August 24, 2008 Share Posted August 24, 2008 There is no way I can check this code as it requires a setup I don't have (you did not provide it)! As I'm int that mode and your utterly, sorry to say this, stupid way of starting, bumping and replies this topic there is no way I will provide a working sample. Post a modified helpfile sample that proves you have tried it. Helpfile sample + the code I posted above should give plenty of clues as that is how I did try it.. You may have to change the *AddIcon stuff to Local $offset=0 _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 10) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 31) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 65) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 68) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 37) _GUIImageList_AddIcon($hImage, "shell32.dll", $offset + 46)to get it going. Depends on the OS, I don't know. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
AoRaToS Posted August 25, 2008 Author Share Posted August 25, 2008 You shouldn't be talking like that, the support forum is for asking and providing help not for making people feel stupid cause they didn't specify exactly.you can see the problem without having to have a local network, I believe the treeview find doesn't return the handle correctly and I can't see why, I'll try and find the solution by myself and post soon... s!mpL3 LAN Messenger Current version 2.9.9.1 [04/07/2019] s!mpL3 LAN Messenger.zip s!mpL3 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