Home | How Do I | Details | Tutorial
MFC supplies class CWnd to encapsulate the HWND handle of a window. The CWnd object is a C++ window object, distinct from the HWND that represents a Windows window but containing it. Use CWnd to derive your own child window classes, or use one of the many MFC classes derived from CWnd. Class CWnd is the base class for all windows, including frame windows, dialog boxes, child windows, controls, and control bars such as toolbars.
MFC uses classes CFrameWnd, CMDIFrameWnd, and CMDIChildWnd to represent single document interface (SDI) and multiple document interface (MDI) frame windows.
MFC manages windows, but you can derive your own classes and use CWnd member functions to customize these windows. You can create child windows by constructing a CWnd object and calling its Create member function, then manage the child windows with other CWnd member functions. You can embed objects derived from CView, such as form views or tree views, in a frame window. And you can support multiple views of your documents via splitter panes, supplied by class CSplitterWnd.
Each object derived from class CWnd contains a message map, through which you can map Windows messages or command IDs to your own handler functions for them.