Question: When we use `WindowFromPoint` winapi function we usually can get the case, when Point specifies to some control within a window. And in such cases `WindowFromPoint` returns handle to that control, not to the window that handles that control.

For example in my small test application if I point to the "body" of chrome browser I get the control with class = `Chrome_RenderWidgetHostHWND` and its hwnd.

But what I need is to get the "parent" window for that control (which is obviously should be the chrome window).

Answer: 
Traverse the parents using [`GetAncestor()`](http://msdn.microsoft.com/en-us/library/ms633502%28VS.85%29.aspx) passing `GA_PARENT`. This differs from calling `GetParent()` which will return the owner if the window is a top-level window.
Can't you just use [GetParent](http://msdn.microsoft.com/en-us/library/ms633510%28v=vs.85%29.aspx)? Keep traversing until you find the desktop window.