Acquire a View HANDLE :: MFC

Started by
5 comments, last by kuphryn 21 years, 11 months ago
Hi. I often see function parameters requiring a handle to a window. I believe the handle to main fram is m_hWnd. In general, how do you get a handle to a window from main frame to any view including splitters? Thanks, Kuphryn
Advertisement
CFrameWnd::GetActiveView
CFrameWnd::GetActiveDocument
CDocument::GetFirstViewPosition
CDocument::GetNextView

You get the picture.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!
Sometimes, the Internet is "smaller" as you would think.
Here.

Forever trusting who we are
And nothing else matters
- Metallica
Forever trusting who we areAnd nothing else matters - Metallica
Thanks.

A member at CodeProject mentioned using IsWindow() to make sure a handle is a handle to a valid window. However, IsWindow() take not parameters and returns a BOOL. I am not sure how to "check" a handle using that function.

Kuphryn
To clarify any confusions, the reason I am asking about HANDLE to MFC windows is, as a member at Anandtech mentioned, I need to pass it to API functions especially winsock. I am shifting gear to network programming in Windows.

Kuphryn
quote:Original post by kuphryn
A member at CodeProject mentioned using IsWindow() to make sure a handle is a handle to a valid window. However, IsWindow() take not parameters and returns a BOOL. I am not sure how to "check" a handle using that function.


::IsWindow takes an HWND. CWnd has a member m_hWnd that holds its HWND.
Ahhhh. Thanks.

Sometimes Visual C++ help is not as effective as real real people.

Kuphryn

This topic is closed to new replies.

Advertisement