Getting Application from Window

Hello !

I got a hWnd (or CWnd) from GetWindowFromPoint(), and I want to know, which application this Window belongs to.
How can I get this ?

Regards

Martin