CWnd Class
Provides the base functionality of all window classes in the Microsoft Foundation Class Library.
class CWnd : public CCmdTarget
Members
Public Constructors
Name |
Description |
---|---|
Constructs a CWnd object. |
Public Methods
Name |
Description |
---|---|
Called by the framework to perform the object's default action. |
|
Called by the framework to retrieve the child element or child object at a given point on the screen. |
|
Called by the framework to retrieve the specified object's current screen location. |
|
Called by the framework to traverse to another user interface element within a container and if possible, retrieve the object. |
|
Called by the framework to modify the selection or move the keyboard focus of the specified object. |
|
Animates the associated window object. |
|
Arranges all the minimized (iconic) child windows. |
|
Attaches a Windows handle to a CWnd object. |
|
Call this member function to make a frame window modal. |
|
Prepares CWnd for painting. |
|
Binds the calling object's default simple bound property, as marked in the type library, to a cursor associated with a data-source control. |
|
Binds a cursor-bound property on a data-bound control to a data-source control and registers that relationship with the MFC binding manager. |
|
Brings CWnd to the top of a stack of overlapping windows. |
|
Called to calculate the window rectangle from the client rectangle. |
|
Disables the tooltip control. |
|
Centers a window relative to its parent. |
|
Removes CWnd from the chain of Clipboard viewers. |
|
Places a check mark next to or removes a check mark from a button control. |
|
Checks the specified radio button and removes the check mark from all other radio buttons in the specified group of buttons. |
|
Determines which, if any, of the child windows contains the specified point. |
|
Converts the client coordinates of a given point or rectangle on the display to screen coordinates. |
|
Minimizes the window. |
|
Continues a window's modal status. |
|
Creates and initializes the child window associated with the CWnd object. |
|
Creates an Active Accessibility proxy for the specified object. |
|
Creates a new shape for the system caret and gets ownership of the caret. |
|
Create an ActiveX control that will be represented in an MFC program by a CWnd object. |
|
Creates a Windows overlapped, pop-up, or child window and attaches it to a CWnd object. |
|
Creates a gray block for the system caret and gets ownership of the caret. |
|
Creates a solid block for the system caret and gets ownership of the caret. |
|
Called automatically by the CWinApp idle-time handler and deletes any temporary CWnd objects created by FromHandle. |
|
Destroys the attached Windows window. |
|
Detaches a Windows handle from a CWnd object and returns the handle. |
|
Fills a list box with a file or directory listing. |
|
Fills the list box of a combo box with a file or directory listing. |
|
Retrieves the current selection from a list box. |
|
Retrieves the current selection from the list box of a combo box. |
|
Indicates the window will accept dragged files. |
|
Captures the mouse and tracks its movement until the user releases the left button, presses the ESC key, or moves the mouse outside the drag rectangle around the specified point. |
|
Draws a wire-frame rectangle and animates it to indicate the opening of an icon or the minimizing or maximizing of a window. |
|
Draws a caption. |
|
Redraws the menu bar. |
|
Enables user-defined Active Accessibility functions. |
|
Enables or disables window D2D support. Call this method before the main window is initialized. |
|
Enables or disables one or both arrows of a scroll bar. |
|
Enables or disables a sibling scroll-bar control. |
|
Enables the tooltip control. |
|
Enables the tooltip control in tracking mode. |
|
Enables or disables mouse and keyboard input. |
|
Ends a window's modal status. |
|
Call this member function to change a frame window from modal to modeless. |
|
Marks the end of painting. |
|
Initiates a dialog resource. |
|
Retrieves the title or text associated with a control in a dialog box. |
|
Returns the handle of the window, which is identified by its window name and window class. |
|
Returns the handle of the window, which is identified by its window name and window class. |
|
Flashes the window once. |
|
Flashes the window with additional functionality. |
|
Returns a pointer to a CWnd object when given a handle to a window. If a CWnd object is not attached to the handle, a temporary CWnd object is created and attached. |
|
Returns a pointer to a CWnd object when given a handle to a window. If a CWnd object is not attached to the handle, a temporary CWnd object is created and attached. |
|
Called by the framework to retrieve the address of an IDispatch interface for the specified child. |
|
Called by the framework to retrieve the number of children belonging to this object. |
|
Called by the framework to retrieve a string that describes the object's default action. |
|
Called by framework to retrieve a string that describes the visual appearance of the specified object. |
|
Called by the framework to retrieve the object that has the keyboard focus. |
|
Called by the framework to retrieve an object's Help property string. |
|
Called by the framework to retrieve the full path of the WinHelp file associated with the specified object and the identifier of the appropriate topic within that file. |
|
Called by the framework to retrieve the specified object's shortcut key or access key. |
|
Called by the framework to retrieve the name of the specified object. |
|
Called by the framework to retrieve the IDispatch interface of the object's parent. |
|
Called by the framework to retrieve information that describes the role of the specified object. |
|
Called by the framework to retrieve the selected children of this object. |
|
Called by the framework to retrieve the current state of the specified object. |
|
Called by the framework to retrieve the value of the specified object. |
|
Retrieves the active window. |
|
Retrieves the ancestor window object of the specified window. |
|
Retrieves the CWnd that has the mouse capture. |
|
Retrieves the client coordinates of the caret's current position. |
|
Returns the ID of the currently checked radio button in a group of buttons. |
|
Gets the dimensions of the CWnd client area. |
|
Retrieves a pointer to the current owner of the Clipboard. |
|
Retrieves a pointer to the first window in the chain of Clipboard viewers. |
|
Retrieves a pointer to an unknown ActiveX control. |
|
Retrieves a display context for the client area. |
|
Retrieves a display context for the client area, and enables clipping while drawing. |
|
Searches all descendant windows and returns the window with the specified ID. |
|
Retrieves the Windows desktop window. |
|
If the CWnd is a child window, calling this function returns its ID value. |
|
Retrieves the control with the specified ID from the specified dialog box. |
|
Translates the text of a control in the given dialog box to an integer value. |
|
Retrieves the caption or text associated with a control. |
|
Retrieves a pointer to the underlying cursor that is defined by the DataSource, UserName, Password, and SQL properties of a data-source control. |
|
Returns the window's extended style. |
|
Retrieves the CWnd that currently has the input focus. |
|
Retrieves the current font. |
|
Returns a pointer to the foreground window (the top-level window with which the user is currently working). |
|
Retrieves the handle to an icon. |
|
Determines which pop-up window owned by CWnd was most recently active. |
|
Retrieves the opacity and transparency color key of a layered window. |
|
Retrieves a pointer to the specified menu. |
|
Searches for the next (or previous) control within a group of controls. |
|
Retrieves the first control with the WS_TABSTOP style that follows (or precedes) the specified control. |
|
Returns the next (or previous) window in the window manager's list. |
|
Retrieves the custom site for the specified ActiveX control. |
|
Retrieves a pointer to the window that currently has the Clipboard open. |
|
Retrieves a pointer to the owner of a CWnd. |
|
Retrieves the parent window of CWnd (if any). |
|
Retrieves the CWnd object's parent frame window. |
|
Returns a pointer to a child window's parent window. |
|
Retrieves an ActiveX control property. |
|
Gets a render target that is associated with this window. |
|
Returns m_hWnd, or NULL if the this pointer is NULL. |
|
Retrieves the safe owner for the given window. |
|
Returns a sibling scroll-bar control. |
|
Retrieves information about the specified scroll bar. |
|
Retrieves the information that the SCROLLINFO structure maintains about a scroll bar. |
|
Retrieves the limit of the scroll bar. |
|
Retrieves the current position of a scroll box. |
|
Copies the current minimum and maximum scroll-bar positions for the given scroll bar. |
|
Returns the current window style. |
|
Allows the application to access the Control menu for copying and modification. |
|
Retrieves information about the specified title bar. |
|
Retrieves the window's top-level frame window. |
|
Retrieves the top-level window. |
|
Retrieves the window's top-level parent. |
|
Returns the first child window that belongs to the CWnd. |
|
Retrieves the coordinates of the smallest rectangle that completely encloses the CWnd update region. |
|
Retrieves the CWnd update region. |
|
Returns the window with the specified relationship to this window. |
|
Retrieves the help context identifier. |
|
Retrieves the display context for the whole window, including the caption bar, menus, and scroll bars. |
|
Returns the number of associated child windows. |
|
Returns information about the window. |
|
Returns the number of associated windowless child windows. |
|
Retrieves the show state and the normal (restored), minimized, and maximized positions of a window. |
|
Gets the screen coordinates of CWnd. |
|
Retrieves a copy of the window region of a window. |
|
Returns the window text or caption title (if it has one). |
|
Returns the length of the window's text or caption title. |
|
Hides the caret by removing it from the display screen. |
|
Highlights or removes the highlighting from a top-level (menu-bar) menu item. |
|
Called to initiate the HTMLHelp application. |
|
Invalidates the entire client area. |
|
Invalidates the client area within the given rectangle by adding that rectangle to the current update region. |
|
Invalidates the client area within the given region by adding that region to the current update region. |
|
Invokes an ActiveX control method or property. |
|
Indicates whether CWnd is a child window or other direct descendant of the specified window. |
|
Determines whether D2D support is enabled. |
|
Determines whether the given message is intended for the modeless dialog box and, if so, processes it. |
|
Determines whether a button control is checked. |
|
Determines whether CWnd is minimized (iconic). |
|
Specifies whether CWnd has touch support. |
|
Determines whether the window is enabled for mouse and keyboard input. |
|
Determines whether the window is visible. |
|
Determines whether CWnd is maximized. |
|
Kills a system timer. |
|
Disables or reenables drawing in the given window. |
|
Converts (maps) a set of points from the coordinate space of the CWnd to the coordinate space of another window. |
|
Creates and displays a window that contains an application-supplied message and caption. |
|
Modifies the current window style. |
|
Modifies the window's extended style. |
|
Changes the position and dimensions of CWnd. |
|
Signals the system that a predefined event occurred. |
|
Implement ambient property values. |
|
Called by the framework when it needs to obtain a bitmap to be displayed on Windows 7 tab thumbnail, or on the client for application peek. |
|
Handles F1 Help within the application (using the current context). |
|
Handles the ID_HELP_FINDER and ID_DEFAULT_HELP commands. |
|
Handles the ID_HELP_INDEX command and provides a default Help topic. |
|
Handles the ID_HELP_USING command. |
|
Determines whether a point is in the bounding rectangle of the specified tool and retrieves information about the tool. |
|
Opens the Clipboard. Other applications will not be able to modify the Clipboard until the Windows CloseClipboard function is called. |
|
Draws windowless controls on the control container. |
|
Places a message in the application queue, then returns without waiting for the window to process the message. |
|
Called before the creation of the Windows window attached to this CWnd object. |
|
Allows other necessary subclassing to occur before SubclassWindow is called. |
|
Used by CWinApp to filter window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. |
|
Draws the current window in the specified device context. |
|
Draws any window in the specified device context (usually a printer device context). |
|
Copies a visual window into the specified device context, typically a printer DC. |
|
Updates the specified rectangle or region in the client area. |
|
Register/Unregister window Windows touch support. |
|
Releases client and window device contexts, freeing them for use by other applications. |
|
Repositions control bars in the client area. |
|
Retrieves, translates, or dispatches messages for a window that is in modal status. |
|
Converts the screen coordinates of a given point or rectangle on the display to client coordinates. |
|
Scrolls the contents of the client area. |
|
Scrolls the contents of the client area. Similar to ScrollWindow, with additional features. |
|
Provides a notification message to a child window, from the parent window, so the child window can handle a task. |
|
Sends a message to the specified control. |
|
Sends a message to the CWnd object and does not return until it has processed the message. |
|
Sends a message to all descendant windows of the window. |
|
Sends the specified message to the window and returns as soon as possible, depending on whether the calling thread created the window. |
|
Activates the window. |
|
Causes all subsequent mouse input to be sent to the CWnd. |
|
Moves the caret to a specified position. |
|
Adds CWnd to the chain of windows that are notified whenever the contents of the Clipboard are changed. |
|
Sets the window or control ID for the window (which can be any child window, not only a control in a dialog box). |
|
Sets the text of a control to the string that represents an integer value. |
|
Sets the caption or text of a control in the specified dialog box. |
|
Claims the input focus. |
|
Sets the current font. |
|
Puts the thread that created the window into the foreground and activates the window. |
|
Sets the handle to a specific icon. |
|
Sets the opacity and transparency color key of a layered window. |
|
Sets the menu to the specified menu. |
|
Changes the owner of a CWnd. |
|
Changes the parent window. |
|
Sets an ActiveX control property. |
|
Allows changes in CWnd to be redrawn or prevents changes from being redrawn. |
|
Sets information about the scroll bar. |
|
Sets the current position of a scroll box and, if specified, redraws the scroll bar to reflect the new position. |
|
Sets minimum and maximum position values for the given scroll bar. |
|
Installs a system timer that sends a WM_TIMER message when triggered. |
|
Sets the help context identifier. |
|
Sets the show state and the normal (restored), minimized, and maximized positions for a window. |
|
Changes the size, position, and ordering of child, pop-up, and top-level windows. |
|
Sets the region of a window. |
|
Sets the window text or caption title (if it has one) to the specified text. |
|
Shows the caret on the display at the caret's current position. Once shown, the caret begins flashing automatically. |
|
Shows or hides all pop-up windows owned by the window. |
|
Displays or hides a scroll bar. |
|
Shows or hides the window. |
|
Attaches a Windows control to a CWnd object and makes it route messages through the CWnd's message map. |
|
Attaches a window to a CWnd object and makes it route messages through the CWnd's message map. |
|
Unlocks a window that was locked with CWnd::LockWindowUpdate. |
|
Detaches a window from a CWnd object |
|
Initializes or retrieves data from a dialog box. |
|
Call to update the state of dialog buttons and other controls. |
|
Updates the position, size, shape, content, and translucency of a layered window. |
|
Updates the client area. |
|
Validates the client area within the given rectangle by removing the rectangle from the current update region. |
|
Validates the client area within the given region by removing the region from the current update region. |
|
Identifies the window that contains the given point. |
|
Called to initiate the WinHelp application. |
Protected Methods
Name |
Description |
---|---|
Calls the default window procedure, which provides default processing for any window messages that an application does not process. |
|
Calls the default window procedure, which provides default processing for any window messages that an application does not process. |
|
For dialog data exchange and validation. Called by UpdateData. |
|
Returns a pointer to the message this window is currently processing. Should only be called when in an OnMessage message-handler member function. |
|
Called when CWnd is being activated or deactivated. |
|
Called when the application is about to be activated or deactivated. |
|
Called when the user generates an application command event. |
|
Called by a Clipboard viewer application when a Clipboard owner will display the Clipboard contents. |
|
Called to allow CWnd to cancel any internal modes, such as mouse capture. |
|
Sends a message to the window that is losing the mouse capture. |
|
Notifies that a specified window is being removed from the chain. |
|
Called when the user interface (UI) state should be changed. |
|
Called when a keystroke translates to a non-system character. |
|
Called by a child list box with the LBS_WANTKEYBOARDINPUT style in response to a WM_CHAR message. |
|
Called for multiple document interface (MDI) child windows whenever the size or position of CWnd changes or CWnd is activated. |
|
Called by a parent window to give a notifying control a chance to respond to a control notification. |
|
Called when the contents of the clipboard have changed. |
|
Called as a signal that CWnd should be closed. |
|
Called when the rendering policy for the non-client area has changed. |
|
Called when the user selects a command. |
|
Called when Windows detects that system memory is low. |
|
Called to determine the relative position of a new item in a child sorted owner-draw combo box or list box. |
|
Called for all top-level windows when the Desktop Window Manager (DWM) composition is enabled or disabled. |
|
Called when the user clicks the right mouse button in the window. |
|
Copies data from one application to another. |
|
Called as a part of window creation. |
|
Called if CWnd is the parent of a control when the control is about to be drawn. |
|
Called when a keystroke translates to a nonsystem dead character (such as accent characters). |
|
Called when an owner-draw child list box or combo box is destroyed or when items are removed from the control. |
|
Called when CWnd is being destroyed. |
|
Called when the Clipboard is emptied through a call to the Windows EmptyClipboard function. |
|
Notifies an application or device driver of a change to the hardware configuration of a device or the computer. |
|
Called for all top-level windows when the user changes device-mode settings. |
|
Called when the contents of the Clipboard change. |
|
Called when a visual aspect of an owner-draw child button control, combo-box control, list-box control, or menu needs to be drawn. |
|
Called when the user releases the left mouse button over a window that has registered itself as the recipient of dropped files. |
|
Called when CWnd is enabled or disabled. |
|
Called when the session is ending. |
|
Called to inform an application's main window procedure that a modal dialog box or a menu is entering an idle state. |
|
Called when a menu modal loop has been entered. |
|
Called after the affected window enters a moving or sizing modal loop. |
|
Called when the window background needs erasing. |
|
Called when a menu modal loop has been exited. |
|
Called after the affected window exits a moving or sizing modal loop. |
|
Called when the pool of font resources changes. |
|
Called for a control so the control can process arrow-key and TAB-key input itself. |
|
Called whenever Windows needs to know the maximized position or dimensions, or the minimum or maximum tracking size. |
|
Called by the framework when the user presses the F1 key. |
|
Called when the user presses a system-wide hot key. |
|
Called when the user clicks the horizontal scroll bar of CWnd. |
|
Called when a Clipboard owner should scroll the Clipboard image, invalidate the appropriate section, and update the scroll-bar values. |
|
Called when CWnd is minimized (iconic) and the background of the icon must be filled before painting the icon. |
|
Called when a menu is about to become active. |
|
Called when a pop-up menu is about to become active. |
|
Called when an I/O device is added or removed from the system. |
|
Called after an application's input language has been changed. |
|
Called when the user chooses a new input language. |
|
Called when a nonsystem key is pressed. |
|
Called when a nonsystem key is released. |
|
Called immediately before CWnd loses the input focus. |
|
Called when the user double-clicks the left mouse button. |
|
Called when the user presses the left mouse button. |
|
Called when the user releases the left mouse button. |
|
Called when the user double-clicks the middle mouse button. |
|
Called when the user presses the middle mouse button. |
|
Called when the user releases the middle mouse button. |
|
Called when an MDI child window is activated or deactivated. |
|
Called for an owner-draw child combo box, list box, or menu item when the control is created. CWnd informs Windows of the dimensions of the control. |
|
Called when the user presses a menu mnemonic character that doesn't match any of the predefined mnemonics in the current menu. |
|
Called when the user begins to drag a menu item. |
|
Called when the mouse cursor enters a menu item or moves from the center of the item to the top or bottom of the item. |
|
Called when the user releases the right mouse button while the cursor is on a menu item. |
|
Called when the user selects a menu item. |
|
Called when the cursor is in an inactive window and the user presses a mouse button. |
|
Called when the cursor hovers over the client area of the window for the period of time specified in a prior call to TrackMouseEvent. |
|
Called when the current window is composed by the Desktop Window Manager (DWM), and that window is maximized. |
|
Called when the cursor leaves the client area of the window specified in a prior call to TrackMouseEvent. |
|
Called when the mouse cursor moves. |
|
Called when a user rotates the mouse wheel. Uses Windows NT 4.0 message handling. |
|
Called after the position of the CWnd has been changed. |
|
Indicates that a user is moving a CWnd object. |
|
Called when the non-client area needs to be changed to indicate an active or inactive state. |
|
Called when the size and position of the client area need to be calculated. |
|
Called prior to OnCreate when the non-client area is being created. |
|
Called when the non-client area is being destroyed. |
|
Called by Windows every time the mouse is moved if CWnd contains the cursor or has captured mouse input with SetCapture. |
|
Called when the user double-clicks the left mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user presses the left mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user releases the left mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user double-clicks the middle mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user presses the middle mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user releases the middle mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the cursor hovers over the non-client area of the window for the period of time specified in a prior call to TrackMouseEvent. |
|
The framework calls this member function when the cursor leaves the non-client area of the window specified in a prior call to TrackMouseEvent. |
|
Called when the cursor is moved within a non-client area of CWnd. |
|
Called when the non-client area needs painting. |
|
Called when the user double-clicks the right mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user presses the right mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the user releases the right mouse button while the cursor is within a non-client area of CWnd. |
|
Called when the rendering policy for the non-client area has changed. |
|
Called when the user double-clicks XBUTTON1 or XBUTTON2 while the cursor is in the non-client area of a window. |
|
Called when the user presses XBUTTON1 or XBUTTON2 of the mouse while the cursor is in the non-client area of a window. |
|
Called when the user releases XBUTTON1 or XBUTTON2 of the mouse while the cursor is in the non-client area of a window. |
|
Called when the right or left arrow key is used to switch between the menu bar and the system menu. |
|
Called by the framework to inform a parent window an event has occurred in one of its controls or that the control needs information. |
|
Called to determine if the current window accepts ANSI or Unicode structures in the WM_NOTIFY notification message. |
|
Called to repaint a portion of the window. |
|
Called when the client area of the Clipboard viewer needs repainting. |
|
Called to allow windows that use a color palette to realize their logical palettes and update their client areas. |
|
Informs other applications when an application is going to realize its logical palette. |
|
Called when a child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. |
|
Called when a power-management event occurs. |
|
Called when a minimized (iconic) CWnd is about to be dragged by the user. |
|
Called when the user chooses to end the Windows session. |
|
Informs CWnd that it is about to receive the input focus. |
|
Called when CWnd is an icon and the user requests that the icon be opened. |
|
Called to retrieve the user interface (UI) state for a window. |
|
Called when the current window gets raw input. |
|
Called when the user double-clicks the right mouse button. |
|
Called when the user presses the right mouse button. |
|
Called when the user releases the right mouse button. |
|
Called when the owner application is being destroyed and needs to render all its formats. |
|
Called for the Clipboard owner when a particular format with delayed rendering needs to be rendered. |
|
Called to notify an application of a change in session state. |
|
Called if mouse input is not captured and the mouse causes cursor movement within a window. |
|
Called after CWnd gains the input focus. |
|
Called when the Win32 SystemParametersInfo function changes a system-wide setting. |
|
Called when CWnd is to be hidden or shown. |
|
Called after the size of CWnd has changed. |
|
Called when the size of the client area of the Clipboard-viewer window has changed. |
|
Indicates that the user is resizing the rectangle. |
|
Called from Print Manager whenever a job is added to or removed from the Print Manager queue. |
|
Indicates that the SetWindowLong Windows function has changed one or more of the window's styles. |
|
Indicates that the SetWindowLong Windows function is about to change one or more of the window's styles. |
|
Called when a keystroke translates to a system character. |
|
Called for all top-level windows when a change is made in the system color setting. |
|
Called when the user selects a command from the Control menu, or when the user selects the Maximize or Minimize button. |
|
Called when a keystroke translates to a system dead character (such as accent characters). |
|
Called when the user holds down the ALT key and then presses another key. |
|
Called when the user releases a key that was pressed while the ALT key was held down. |
|
Called when the user clicks an authorable button. |
|
Called for all top-level windows after the system time changes. |
|
Called after each interval specified in SetTimer. |
|
Process single input from Windows touch. |
|
Process inputs from Windows touch. |
|
Called when a key is pressed. That is, the current window has the keyboard focus and a WM_KEYDOWN message is translated by the TranslateMessage function. |
|
Called when a drop-down menu or submenu has been destroyed. |
|
Called to change the user interface (UI) state for the specified window and all its child windows. |
|
Called after the user has logged on or off. |
|
Called by a list box owned by CWnd in response to a WM_KEYDOWN message. |
|
Called when the user clicks the window's vertical scroll bar. |
|
Called when the owner should scroll the Clipboard image, invalidate the appropriate section, and update the scroll-bar values. |
|
Called when the size, position, or Z-order has changed as a result of a call to SetWindowPos or another window-management function. |
|
Called when the size, position, or Z-order is about to change as a result of a call to SetWindowPos or another window-management function. |
|
Called for all top-level windows after the Windows initialization file, WIN.INI, is changed. |
|
Indicates if a windows message was handled. |
|
Called when the user double-clicks XBUTTON1 or XBUTTON2 while the cursor is in the client area of a window. |
|
Called when the user presses XBUTTON1 or XBUTTON2 while the cursor is in the client area of a window. |
|
Called when the user releases XBUTTON1 or XBUTTON2 while the cursor is in the client area of a window. |
|
This virtual function is called by the default OnNcDestroy function after the window has been destroyed. |
|
Helper function which reflects a message to its source. |
|
Reflects the last message to the child window. |
|
Provides a window procedure for a CWnd. The default dispatches messages through the message map. |
Public Operators
Name |
Description |
---|---|
Call to get a handle to a window. |
|
Determines if a window is not the same as the window whose handle is m_hWnd. |
|
Determines if a window is the same as the window whose handle is m_hWnd. |
Public Data Members
Name |
Description |
---|---|
Indicates the HWND attached to this CWnd. |
Remarks
A CWnd object is distinct from a Windows window, but the two are tightly linked. A CWnd object is created or destroyed by the CWnd constructor and destructor. The Windows window, on the other hand, is a data structure internal to Windows that is created by a Create member function and destroyed by the CWnd virtual destructor. The DestroyWindow function destroys the Windows window without destroying the object.
The CWnd class and the message-map mechanism hide the WndProc function. Incoming Windows notification messages are automatically routed through the message map to the proper OnMessage CWnd member functions. You override an OnMessage member function to handle a member's particular message in your derived classes.
The CWnd class also lets you create a Windows child window for your application. Derive a class from CWnd, then add member variables to the derived class to store data specific to your application. Implement message-handler member functions and a message map in the derived class to specify what happens when messages are directed to the window.
You create a child window in two steps. First, call the constructor CWnd to construct the CWnd object, then call the Create member function to create the child window and attach it to the CWnd object.
When the user terminates your child window, destroy the CWnd object, or call the DestroyWindow member function to remove the window and destroy its data structures.
Within the Microsoft Foundation Class Library, further classes are derived from CWnd to provide specific window types. Many of these classes, including CFrameWnd, CMDIFrameWnd, CMDIChildWnd, CView, and CDialog, are designed for further derivation. The control classes derived from CWnd, such as CButton, can be used directly or can be used for further derivation of classes.
For more information on using CWnd, see Frame Windows and Window Objects.
Inheritance Hierarchy
CWnd
Requirements
Header: afxwin.h