Lemon.fr Posted April 8, 2006 Share Posted April 8, 2006 Hi, I really need help about this, from the Help files it seems the TreeView Items clicks are captured with GUIGetMsg, but im working with a big treeview... ; Need help to capture events on TreeviewItems as Click,DblClick in a better way ; includes #include <GUIConstants.au3> ; $myGui=GUICreate("TVI click & DblClick ?",300,400,-1,-1) $myTreeView=GUICtrlCreateTreeView(10,10,280,350) ; few parent items, Control IDs stored in array Dim $MainItem[3] $MainItem[0]=GUICtrlCreateTreeViewItem("Item1",$myTreeView) $MainItem[1]=GUICtrlCreateTreeViewItem("Item2",$myTreeView) $MainItem[2]=GUICtrlCreateTreeViewItem("Item3",$myTreeView) ; lots of subitems, Control IDs stored in array $MaxSubItems=300 Dim $SubItems[$MaxSubItems] For $i=0 to $MaxSubItems-1 $r=Random(0,2,1); from 0 to 2 and return an Int $SubItems[$i]=GUICtrlCreateTreeViewItem("SubItem "&$i,$MainItem[$r]) Next GUISetState(@SW_SHOW,$myGui) ; Main event loop While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop ; Now i want to capture a click on a subitem... For $i=0 to $MaxSubItems-1 If $msg=$SubItems[$i] Then ItemClicked($i) Next Wend Func ItemClicked($ItemNumber) MsgBox (0,"","SubItem "&$ItemNumber&" clicked !") EndFunc If $MaxSubItems=300 then it's fast enought to capture the event, but try $MaxSubItems=3000 (or more if you have a faster cpu than mine), Sure, a treeview with 3000 subitems is a rare thing but i would have an alternative way to capture the selected subitems (because i may have also more controls in my gui) and i need it to return the CtrlID of the clicked subitems, i will also need to capture a doubleClick on a Subitem. Any ideas ? Thx. ps: Nice community by the way Link to comment Share on other sites More sharing options...
Valuater Posted April 8, 2006 Share Posted April 8, 2006 maybe this can help, there is a "double click" post in thishttp://www.autoitscript.com/forum/index.ph...2717&hl=double#8) Link to comment Share on other sites More sharing options...
Zedna Posted April 8, 2006 Share Posted April 8, 2006 In link from Valuater search function GUIRegisterMsg(), it's core of solution ... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Lemon.fr Posted April 8, 2006 Author Share Posted April 8, 2006 In link from Valuater search function GUIRegisterMsg(), it's core of solution ...Thanks guys, yes i knew i need to use these Win32 API messages thingy...im really a noob at it but i would learn it because it looks really intersting. Where could i find tutorials and desciptions of API messages ? (googled on MS website with no result) Link to comment Share on other sites More sharing options...
Zedna Posted April 9, 2006 Share Posted April 9, 2006 (edited) Thanks guys, yes i knew i need to use these Win32 API messages thingy...im really a noob at it but i would learn it because it looks really intersting. Where could i find tutorials and desciptions of API messages ? (googled on MS website with no result)See my post: Win32 API documentationEDIT: And at MSDN is online documentation for all that Win32 API stufftype name of desired API function into Search edit for detailed info... Edited April 9, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Lemon.fr Posted April 9, 2006 Author Share Posted April 9, 2006 (edited) See my post: Win32 API documentationEDIT: And at MSDN is online documentation for all that Win32 API stufftype name of desired API function into Search edit for detailed info...Yes, thanks After many search, i also found this:http://www.microsoft.com/msdownload/platfo...FULLInstall.htmFree download and you dont need Visual Studio install Edit: if you install it, you will find in C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Includeall the .h files with constants in, im gonna write my own includes with all needed constants, maybe someone did it, i dunno Edited April 9, 2006 by Lemon.fr Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 10, 2006 Moderators Share Posted April 10, 2006 Yes, thanks After many search, i also found this:http://www.microsoft.com/msdownload/platfo...FULLInstall.htmFree download and you dont need Visual Studio install Edit: if you install it, you will find in C:\Program Files\Microsoft Platform SDK for Windows XP SP2\Includeall the .h files with constants in, im gonna write my own includes with all needed constants, maybe someone did it, i dunno One way to find out, when you find your constants, do a search for them like this: $Constant1+$Constant2+$Constant3, That will tell you if your doing all the work for practice or not Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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