How can i convert HWND to CWnd?

Started by
1 comment, last by wah_on_2 21 years, 6 months ago
I am write a program that will call MFC dll, and the dll need pass Cwnd and i just have HWND. How can i conver it? Thanks
Advertisement
BOOL CWnd::Attach(HWND hWndNew) will associate a window handle with the CWnd object.

hth
CWnd::FromHandle(HWND);

Upon review, this only creates a temporary object, so it may not be what you want.

Creating a CWnd yourself and then calling Attach() is probably better.

[edited by - cgoat on October 16, 2002 9:46:40 AM]

This topic is closed to new replies.

Advertisement