Question: I am curious how spy++ Finder Tool finds out the window handle for the window over which the mouse is. 
Is there any WIN32 function for getting the handle of the topmost window that occupies a certain pixel on the display?

Answer: 
Here is a pretty complete example of how to implement the spy++ finder.

<http://www.codeproject.com/KB/dialog/windowfinder.aspx>
[`WindowFromPoint`](http://msdn.microsoft.com/library/ms633558(VS.85)) or [`ChildWindowFromPoint`](http://msdn.microsoft.com/library/ms632676(VS.85)) API functions.