CWindow Class
This class provides methods for manipulating a window.
Important
This class and its members cannot be used in applications that execute in the Windows Runtime.
class CWindow
Members
Public Constructors
Name |
Description |
---|---|
Constructor. |
Public Methods
Name |
Description |
---|---|
Arranges all minimized child windows. |
|
Attaches a window to the CWindow object. |
|
Prepares the window for painting. |
|
Brings the window to the top of the Z order. |
|
Centers the window against a given window. |
|
Removes the window from the chain of Clipboard viewers. |
|
Changes the check state of the specified button. |
|
Checks the specified radio button. |
|
Retrieves the child window containing the specified point. |
|
Retrieves a particular type of child window containing the specified point. |
|
Converts client coordinates to screen coordinates. |
|
Creates a window. |
|
Creates a new shape for the system caret. |
|
Creates a gray rectangle for the system caret. |
|
Creates a solid rectangle for the system caret. |
|
Updates the specified multiple-window-position structure for the specified window. |
|
Destroys the window associated with the CWindow object. |
|
Detaches the window from the CWindow object. |
|
Fills a list box with the names of all files matching a specified path or file name. |
|
Fills a combo box with the names of all files matching a specified path or file name. |
|
Retrieves the current selection from a list box. |
|
Retrieves the current selection from a combo box. |
|
Registers whether the window accepts dragged files. |
|
Redraws the window's menu bar. |
|
Enables or disables the scroll bar arrows. |
|
Enables or disables input. |
|
Marks the end of painting. |
|
Flashes the window once. |
|
Retrieves the coordinates of the client area. |
|
Retrieves a device context for the client area. |
|
Retrieves a device context for the client area and allows clipping options. |
|
Retrieves the specified descendant window. |
|
Retrieves an interface on the specified control. |
|
Retrieves the window's identifier (for child windows only). |
|
Retrieves a pointer to an interface to the ATL Control hosting container. |
|
Retrieves the specified child window. |
|
Translates a control's text to an integer. |
|
Retrieves a control's text. |
|
Retrieves the extended window styles. |
|
Retrieves the window's current font. |
|
Determines the hot key associated with the window. |
|
Retrieves the window's large or small icon. |
|
Retrieves the most recently active pop-up window. |
|
Retrieves the window's menu. |
|
Retrieves the previous or next control within a group of controls. |
|
Retrieves the previous or next control having the WS_TABSTOP style. |
|
Retrieves the immediate parent window. |
|
Retrieves the parameters of a scroll bar. |
|
Retrieves the position of the scroll box. |
|
Retrieves the scroll bar range. |
|
Retrieves the window styles. |
|
Creates a copy of the system menu for modification. |
|
Retrieves the top-level parent or owner window. |
|
Retrieves the top-level owner window. |
|
Retrieves the top-level child window. |
|
Retrieves the coordinates of the smallest rectangle that completely encloses the update region. |
|
Retrieves the update region and copies it into a specified region. |
|
Retrieves the specified window. |
|
Retrieves the window's help context identifier. |
|
Retrieves a device context for the entire window. |
|
Retrieves a 32-bit value at a specified offset into the extra window memory. |
|
Retrieves information about the specified window, including a value at a specified offset into the extra window memory. |
|
Retrieves the show state and positions. |
|
Retrieves the identifier of the process that created the window. |
|
Retrieves the window's bounding dimensions. |
|
Obtains a copy of the window region of a window. |
|
Retrieves the window's text. |
|
Retrieves the length of the window's text. |
|
Retrieves the identifier of the thread that created the specified window. |
|
Retrieves a 16-bit value at a specified offset into the extra window memory. |
|
Sets the keyboard focus to a control in the dialog box. |
|
Hides the system caret. |
|
Highlights or removes the highlight from a top-level menu item. |
|
Invalidates the entire client area. |
|
Invalidates the client area within the specified rectangle. |
|
Invalidates the client area within the specified region. |
|
Determines whether the specified window is a child window. |
|
Determines whether a message is intended for the specified dialog box. |
|
Determines the check state of the button. |
|
Determines whether the window is minimized. |
|
Determines if the parent window of a control is a dialog window. |
|
Determines whether the specified window handle identifies an existing window. |
|
Determines whether the window is enabled for input. |
|
Determines whether the specified window is a native Unicode window. |
|
Determines the window's visibility state. |
|
Determines whether the window is maximized. |
|
Destroys a timer event. |
|
Disables or enables drawing in the window. |
|
Converts a set of points from the window's coordinate space to the coordinate space of another window. |
|
Displays a message box. |
|
Modifies the window styles. |
|
Modifies the extended window styles. |
|
Changes the window's size and position. |
|
Sets the keyboard focus to the next control in the dialog box. |
|
Opens the Clipboard. |
|
Places a message in the message queue associated with the thread that created the window. Returns without waiting for the thread to process the message. |
|
Sets the keyboard focus to the previous control in the dialog box. |
|
Requests that the window be drawn in a specified device context. |
|
Requests that the window's client area be drawn in a specified device context. |
|
Updates a specified rectangle or region in the client area. |
|
Releases a device context. |
|
Resizes the window. |
|
Converts screen coordinates to client coordinates. |
|
Scrolls the specified client area. |
|
Scrolls the specified client area with additional features. |
|
Sends a message to a control. |
|
Sends a message to the window and does not return until the window procedure has processed the message. |
|
Sends a message to the specified descendant windows. |
|
Sends a message to the window. If the window was created by the calling thread, SendNotifyMessage does not return until the window procedure has processed the message. Otherwise, it returns immediately. |
|
Activates the window. |
|
Sends all subsequent mouse input to the window. |
|
Adds the window to the Clipboard viewer chain. |
|
Changes the window's identifier. |
|
Changes a control's text to the string representation of an integer value. |
|
Changes a control's text. |
|
Sets the input focus to the window. |
|
Changes the window's current font. |
|
Associates a hot key with the window. |
|
Changes the window's large or small icon. |
|
Changes the window's current menu. |
|
Changes the parent window. |
|
Sets or clears the redraw flag. |
|
Sets the parameters of a scroll bar. |
|
Changes the position of the scroll box. |
|
Changes the scroll bar range. |
|
Creates a timer event. |
|
Sets the window's help context identifier. |
|
Sets a 32-bit value at a specified offset into the extra window memory. |
|
Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory. |
|
Sets the show state and positions. |
|
Sets the size, position, and Z order. |
|
Sets the window region of a window. |
|
Changes the window's text. |
|
Sets a 16-bit value at a specified offset into the extra window memory. |
|
Displays the system caret. |
|
Shows or hides the pop-up windows owned by the window. |
|
Shows or hides a scroll bar. |
|
Sets the window's show state. |
|
Sets the show state of a window created by a different thread. |
|
Updates the client area. |
|
Validates the client area within the specified rectangle. |
|
Validates the client area within the specified region. |
|
Starts Windows Help. |
Public Operators
Name |
Description |
---|---|
Converts the CWindow object to an HWND. |
|
Assigns an HWND to the CWindow object. |
Public Data Members
Name |
Description |
---|---|
The handle to the window associated with the CWindow object. |
|
Contains default window dimensions. |
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 Windows 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 Windows SDK. For more information about using windows in ATL, see the article ATL Window Classes.
Requirements
Header: atlwin.h