你查的蛮快的啊 ~
------------------------------------------------------
WindowFromDC
The WindowFromDC function returns a handle to the window associated with the specified display device context (DC). Output functions that use the specified device context draw into this window.
HWND WindowFromDC(
HDC hDC // handle to window
);
Parameters
hDC
[in] Handle to the device context from which a handle for the associated window is to be retrieved.
Return Values
The return value is a handle to the window associated with the specified DC. If no window is associated with the specified DC, the return value is NULL.
Requirements
Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use User32.lib.
See Also
Painting and Drawing Overview, Painting and Drawing Functions, GetDC, GetDCEx, GetWindowDC