I would like to build a widget wherein I can drag another application's window onto my widget and drop it. My widget will then do things with the other window such as minimize, move it, etc.

How do I sense when the other application is dropped on my widget ? I have drag and drop working for text file, etc. but it doesn't work for another window, probably because the other window receives the mouse events of the drop, not my widget.

Is there a way to capture a drag and drop event for the desktop from my widget ?

Once the other application's window is dropped on my widget, I need to get the handle of the other window. How do I do that ?