When a user selects a file , I want to know which Window has the current focus .

Just to explain, I am providing a scnearios.

1) User selects abc.txt on the Desktop
2) User selects xyz.doc in the Explorer.

Though both files have the LVM_SELECTED flag set, I want to get the handle of the window in which the file has been selected.

I tried with GetForegroundWindow, and GetGUIThreadInfo , but its not working.

Any sort of help would be appreicated

Sujay