Ok guys,
I'll get into code if people really want it, my code is very long. I would need to just write an example explaining my question.
In case my words are enough here goes
I have a form with many list views (7) and 2 treeviews. When I drag and drop i need to know which list view I dragged from, and which treeview I dropped on. My message loop code is failing miserably and I have tunnel vision! How can I do this?
Im trying to capture the "from" control and the "to" control but the Mousemove event is firing the whole time i'm dragging, so the hWnd changes to the tree view as soon as I leave the listview.
So when the drop event fires, the to and from array are both set to the treeview's hWnd. Help! haha
While 1
$idMsg = GUIGetMsg()
Switch $idMsg
Case $GUI_EVENT_MOUSEMOVE
if _IsPressed("01") Then
$aHwndFrom = DllCall("user32.dll", "hwnd", "WindowFromPoint", "uint", MouseGetPos(0), "uint", MouseGetPos(1)); <-- not correct for the drop event usage because it flips to the treeview
dragEvent($aHwndFrom[0]) ;<--- fires ok for the drag event
endif
Case $GUI_EVENT_DROPPED
$aHwndTo = DllCall("user32.dll", "hwnd", "WindowFromPoint", "uint", MouseGetPos(0), "uint", MouseGetPos(1))
myDrop($aHwndTo[0],$aHwndFrom[0]) ;<--- passing what is supposed to be a listview Hwnd in the "from" array, and the treeview hWnd in the "to" array but they are both set to the treeview because that is where I end up on the drop event
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Trying to figure out how to target the to and from controls is making my brain turn to mush.... probably not a good thing!