CWindow

class CWindow

CWindow provides the base functionality for manipulating a window in ATL. Many of the CWindow methods simply wrap one of the Win32 API functions. For example, compare the prototypes for CWindow::ShowWindow and ::ShowWindow:

CWindow method Win32 function
BOOL ShowWindow( int nCmdShow ); BOOL ShowWindow( HWND hWnd, int nCmdShow );

CWindow::ShowWindow calls the Win32 function ShowWindow by passing CWindow::m_hWnd as the first parameter. Every CWindow method that directly wraps a Win32 function passes the m_hWnd member; therefore, much of the CWindow documentation will refer you to the Win32 SDK documentation.

Note   Not every window-related Win32 function is wrapped by CWindow, and not every CWindow method wraps a Win32 function.

CWindow::m_hWnd stores the HWND that identifies a window. An HWND is attached to your object when you:

For more information about windows, see Windows and subsequent topics in the Win32 SDK. For more information about using windows in ATL, see the article ATL Window Classes.

#include <atlwin.h>

Class Members