TreeView bug

BlitzMax Forums/MaxGUI Module/TreeView bug

JoshK(Posted 2010) [#1]
If you have one treeview node selected and double-click on the expand/collapse icon of another node, a GADGETACTION event will occur, using the selected treeview node you didn't click on for the event extra parameter.

For the double-click event, the routine should find which node exists at the position that is clicked and use that for the event extra parameter.



Here's some information:
http://msdn.microsoft.com/en-us/library/bb774867%28VS.85%29.aspx

And my attempt to fix it. I just don't know how to convert the handle of the Windows tree node to a MaxGUI treeview node:
Type LVHITTESTINFO
	Field x:Int
	Field y:Int
	Field flags:Int
	Field iItem:Int
	Field iSubItem:Int
	Field iGroup:Int
EndType

In the event processing section:

			Case NM_RETURN
				PostGuiEvent EVENT_GADGETACTION,0,0,0,0,_selected
			
			Case NM_DBLCLK
				Local hit:Int
				Local lvhititemtest:LVHITTESTINFO=New LVHITTESTINFO
				hit=SendMessage(hWnd,LVM_SUBITEMHITTEST,0,lvhititemtest)
				Print lvhititemtest.iItem
				node=TWindowsTreeNode(HandleToObject(?))
				PostGuiEvent EVENT_GADGETACTION,0,0,0,0,node