CWindow Class Home
This page is specific to:.NET Framework Version:1.12.03.54.0
ATL Library Reference
CWindow Class

This class provides methods for manipulating a window.

class CWindow

Remarks

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 Platform SDK.

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:

  • Specify an HWND in CWindow's constructor.
  • Call CWindow::Attach.
  • Use CWindow's operator =.
  • Create or subclass a window using one of the following classes derived from CWindow:

    CWindowImpl   Allows you to create a new window or subclass an existing window.

    CContainedWindow   Implements a window contained within another object. You can create a new window or subclass an existing window.

    CDialogImpl   Allows you to create a modal or modeless dialog box.

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

Requirements

Header: atlwin.h

See Also

Class Members | ATL Class Overview

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View