Hey
Your question is little bit wage but still
At the moment I do not know how to detect which listbox is in use. What do u mean by this? If that means list box selection then use a object which will have the instance of the valid list box.
Update:You can select the listbox based on the mouse click(I hope the last click in either of the list box is the active one)