CWnd

Win32++

CWnd Class

Description

The CWnd class represents a window. CWnd handles such things as window creation and window destruction, as well as determining how the window messages are handled.  Each window created by Win32++  is a CWnd object, or an object derived from CWnd. Many of the classes in Win32++ are inherited from CWnd, including CFrame, CMDIChild, CMDIFrame, CMenuBar, CReBar, CStatusBar, and CToolBar.

Inherit from this class in your own application to create windows. The WndProc member function is called whenever the window associated with the CWnd object receives a Window message. Override WndProc to handle window messages, and pass all unhandled messages on to WndProcDefault.
 

CWnd Members:

Construction

CWnd
CWnd();
Constructs a CWnd object

Operations

operator HWND
operator HWND() const;
Returns the HWND belonging to this CWnd.
Attach
virtual BOOL Attach(HWND hWnd);
Attaches a CWnd object to an existing window.
AttachDlgItem
virtual BOOL AttachDlgItem(UINT nID, CWnd* pParent);
Attaches a CWnd object to a dialog item.
CenterWindow
virtual void CenterWindow() const;
Positions the window over the center of its parent.
Create
virtual HWND Create(CWnd* pParent = NULL);
Creates the window with default parameters. Use PreCreate to set the default parameters.
CreateEx
virtual HWND CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName, 
                      LPCTSTR lpszWindowName, DWORD dwStyle, 
                      int x, int y, int nWidth, int nHeight, 
                      HWND hwndParent, HMENU nIDorHMenu, LPVOID lpParam = NULL);
virtual HWND CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName, 
	             LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rc, 
	             CWnd* pParent, UINT nID, LPVOID lpParam = NULL);
Creates the window by specifying each parameter.
Destroy
virtual void Destroy();
Destroys the window associated with the CWnd, and returns the CWnd to its default state.
Detach
virtual HWND Detach();
Detaches a window from a CWnd object. It reverses an attach.
FromHandle
static CWnd* FromHandle(HWND hWnd);
Returns the CWnd associated with the specified window handle. If a CWnd object doesn't already exist for this HWND, a temporary CWnd object is created. This temporary CWnd will be deleted sometime after the processing of the current message is complete.
FromHandlePermanent
static CWnd* FromHandlePermanent(HWND hWnd);
Returns the CWnd associated with the specified window handle. If a CWnd object doesn't already exist for this HWND, this function returns NULL.
FinalWindowProc
virtual LRESULT FinalWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
Passes messages on to the appropriate default window procedure. When a message is handled, the function should either return FinalWindowProc or a specific value recommended in the Windows API documentation.
Invalidate
virtual void Invalidate(BOOL bErase = TRUE) const;
Invalidates the entire window. The window will be redrawn when the next WM_PAINT message is processed.
SetIconLarge
virtual HICON SetIconLarge(int nIcon);
Loads the large icon from the specified resource, and assigns it to the window.
SetIconSmall
virtual HICON SetIconSmall(int nIcon);
Loads the small icon from the specified resource, and assigns it to to the window.
WndProcDefault
virtual LRESULT WndProcDefault(UINT uMsg, WPARAM wParam, LPARAM lParam);
Don't override this function. Pass all unhandled messages to WndProcDefault when overriding WndProc.

Overridables

OnAttach
virtual void OnAttach();
Called when a window is attached to the CWnd. Note that window controls are subclassed after they are created, and call OnAttach.
OnCommand
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
Called when the user selects a command, typically in response to a menu or toolbar button.
OnClose
virtual void OnClose();
Called in response to WM_CLOSE. Override to suppress destroying the window. A WM_CLOSE is sent by SendMessage(WM_SYSCOMMAND, SC_CLOSE, 0) or by clicking the X to close the window.
OnCreate
virtual void OnCreate();
Called during window creation. Override this function to perform tasks such as creating child windows. Note that window controls are attached after they are created, and don't call OnCreate.
OnDestroy
virtual void OnDestroy();
This function is called when a window is destroyed. Override it to do additional tasks, such as ending the application with PostQuitMessage..
OnDraw
virtual void OnDraw(CDC* pDC);
Called when part of the window is about to be redrawn. Override this function to specify how the window should be drawn.
OnEraseBkGnd
virtual BOOL OnEraseBkgnd(CDC* pDC);
Called when part of the window background is erased. Override this function to specify how the window's background should be drawn.
OnInitialUpdate
virtual void OnInitialUpdate();
Called after the window is created. Override this function to perform tasks once the window is created.
OnMenuUpdate
virtual void OnMenuUpdate(UINT nID);
Called when a popup menu is about to be displayed. Override this function to set or clear the check box or radio button to menu items.
OnMessageReflect
virtual LRESULT OnMessageReflect(UINT uMsg, WPARAM wParam, LPARAM lParam);
Called when a notification message is sent to the parent.  Override this function to handle these notification messages in the CWnd that generated them.
OnNotify
virtual LRESULT OnNotify(WPARAM wParam, LPARAM lParam);
Called when a WM_NOTIFY message is received from a child window. Override this function to handle notifications in the parent's CWnd.
OnNotifyReflect
virtual LRESULT OnNotifyReflect(WPARAM wParam, LPARAM lParam);
Called when a WM_NOTIFY message is sent to the parent. Override this function to handle notifications in the CWnd that generated them.
PreCreate
virtual void PreCreate(CREATESTRUCT& cs);
Override this function to set the window creation parameters used by Create.
PreRegisterClass
virtual void PreRegisterClass(WNDCLASS& wc);
Override the function to set the window class parameters used by Create.
PreTranslateMessage
virtual BOOL PreTranslateMessage(MSG* pMsg);
Override this function to filter mouse and keyboard messages prior to being passed to the message loop.
WndProc
virtual LRESULT WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam);
Override this function to specify how the messages for this window are to be handled. Return all unhandled messages to WndProcDefault.

Attributes

FromHandle
static CWnd* FromHandle(HWND hWnd);
Returns a pointer to the CWnd object, given the window handle (HWND).
GetHwnd
HWND GetHwnd() const;
Returns the handle of the window associated with CWnd.
GetPrevWindowProc
WNDPROC GetPrevWindowProc() const;
Pointer to the Window Procedure prior to it being subclassed.

Member Variables

m_hWnd
HWND m_hWnd;
Handle to the CWnd's window.

Wrappers for Window API functions and messages (don't override these).

BeginPaint
CDC* BeginPaint(PAINTSTRUCT& ps) const;
Prepares the specified window for painting and fills a PAINTSTRUCT structure with information about the painting.
BringWindowToTop
BOOL BringWindowToTop() const;
Brings the window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.
CallWindowProc
LRESULT CallWindowProc(WNDPROC lpPrevWndFunc, UINT Msg, 
                       WPARAM wParam, LPARAM lParam) const;
Passes message information to the specified window procedure.
CheckDlgButton
BOOL CheckDlgButton(int nIDButton, UINT uCheck) const;
Changes the check state of a button control.
CheckRadioButton
BOOL CheckRadioButton(int nIDFirstButton, int nIDLastButton, 
                      int nIDCheckButton) const;
Adds a check mark to (checks) a specified radio button in a group and removes a check mark from (clears) all other radio buttons in the group.
ChildWindowFromPoint
CWnd* ChildWindowFromPoint(POINT pt) const;
Determines which, if any, of the child windows belonging to a parent window contains the specified point. The search is restricted to immediate child windows. Grandchildren, and deeper descendant windows are not searched.
ClientToScreen
BOOL ClientToScreen(POINT& pt) const;
BOOL ClientToScreen(RECT& rc) const;
Converts the client-area coordinates of a specified point to screen coordinates..
CloseWindow
BOOL CloseWindow() const;
Minimizes (but does not destroy) the window. This function is not supported on WinCE.
DefWindowProc
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam) const;
Calls the default window procedure to provide default processing for any window messages that an application does not process.
DeferWindowPos
HDWP DeferWindowPos(HDWP hWinPosInfo, const CWnd* pInsertAfter, 
                    int x, int y, int cx, int cy, UINT uFlags) const;
HDWP DeferWindowPos(HDWP hWinPosInfo, const CWnd* pInsertAfter, 
	           const RECT& rc, UINT uFlags) const;
Updates the multiple window position structure for the window. The function then returns a handle to the updated structure.
DlgDirList
int DlgDirList(LPTSTR lpPathSpec, int nIDListBox, 
               int nIDStaticPath, UINT uFileType) const;
Replaces the contents of a list box with the names of the subdirectories and files in a specified directory. You can filter the list of names by specifying a set of file attributes. This function is not supported on WinCE.
DlgDirListComboBox
int DlgDirListComboBox(LPTSTR lpPathSpec, int nIDComboBox, 
                       int nIDStaticPath, UINT uFiletype) const;
Replaces the contents of a combo box with the names of the subdirectories and files in a specified directory. You can filter the list of names by specifying a set of file attributes. This function is not supported on WinCE.
DlgDirSelectEx
BOOL DlgDirSelectEx(LPTSTR lpString, int nCount, int nIDListBox) const;
Retrieves the current selection from a single-selection list box. It assumes that the list box has been filled by the DlgDirList function and that the selection is a drive letter, filename, or directory name. This function is not supported on WinCE.
DlgDirSelectComboBoxEx
BOOL DlgDirSelectComboBoxEx(LPTSTR lpString, int nCount, 
                            int nIDComboBox) const;
Retrieves the current selection from a combo box filled by using the DlgDirListComboBox function. The selection is interpreted as a drive letter, a file, or a directory name. This function is not supported on WinCE.
DrawAnimatedRects
BOOL DrawAnimatedRects(int idAni, RECT& rcFrom, RECT& rcTo) const;
Draws a wire-frame rectangle and animates it to indicate the opening of an icon or the minimizing or maximizing of a window. This function is not supported on WinCE.
DrawCaption
BOOL DrawCaption(CDC* pDC, RECT& rc, UINT uFlags) const;
Draws a window caption. This function is not supported on WinCE.
DrawMenuBar
BOOL DrawMenuBar() const;
Redraws the menu bar of the window. If the menu bar changes after the system has created the window, this function must be called to draw the changed menu bar.
EnableScrollBar
BOOL EnableScrollBar(UINT uSBflags, UINT uArrows) const;
Enables or disables one or both scroll bar arrows.  This function is not supported on WinCE.
EnableWindow
BOOL EnableWindow(BOOL bEnable = TRUE) const;
The EnableWindow function enables or disables mouse and keyboard input to the specified window or control. When input is disabled, the window does not receive input such as mouse clicks and key presses. When input is enabled, the window receives all input.
EndPaint
BOOL EndPaint(PAINTSTRUCT& ps) const;
Marks the end of painting in the specified window. This function is required for each call to the BeginPaint function, but only after painting is complete.
GetActiveWindow
CWnd* GetActiveWindow() const;
Returns the pointer to the active window. This pointer might be temporary, so don't save it for later use.
GetAncestor
CWnd* GetAncestor(UINT gaFlag = 3 /*= GA_ROOTOWNER*/) const;
Returns the pointer to the ancestor window. This pointer might be temporary, so don't save it for later use.
GetCapture
CWnd* GetCapture() const;
Returns the pointer to the window (if any) that has captured the mouse. This pointer might be temporary, so don't save it for later use.
GetClassLongPtr
ULONG_PTR GetClassLongPtr(int nIndex) const;
Retrieves the specified value from the WNDCLASSEX structure associated with the window.
GetClassName
LPCTSTR GetClassName() const;
Returns a pointer to a TCHAR array containing the class name of the window.
GetClientRect
CRect GetClientRect() const;
Retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).
GetDC
CDC* GetDC() const;
Retrieves a pointer to the display device context (CDC) for the client area of the window.
GetDCEx
CDC* GetDCEx(HRGN hrgnClip, DWORD flags) const;
Retrieves a pointer to a display device context (CDC) for the client area of the window. This function is an extension to the GedDC function, which gives an application more control over how and whether clipping occurs in the client area.
GetDesktopWindow
CWnd* GetDesktopWindow() const;
Retrieves a pointer to the desktop window. This pointer might be temporary, so don't save it for later use.
GetDlgCtrlID
int GetDlgCtrlID() const;
Retrieves the control ID value for any child window.
GetDlgItem
CWnd* GetDlgItem(int nIDDlgItem) const;
Retrieves a pointer to a control in the dialog box. This pointer might be temporary, so don't save it for later use.
GetDlgItemInt
UINT GetDlgItemInt(int nIDDlgItem, BOOL* lpTranslated, BOOL bSigned) const;
Translates the text of a specified control in a dialog box into an integer value. 
GetDlgItemText
LPCTSTR GetDlgItemText(int nIDDlgItem) const;
Retrieves the title or text associated with a control in a dialog. 
GetFont
CFont* GetFont() const;
Retrieves a handle to the font assigned to the window.
GetIcon
HICON GetIcon(BOOL bBigIcon) const;
Retrieves a handle to the icon assigned to the window.
GetLastActivePopup
CWnd* GetLastActivePopup() const;
Retrieves the pointer to the pop-up window owned by the window which was most recently active. This pointer might be temporary, so don't save it for later use.
GetMenu
CMenu* GetMenu() const;
Retrieves a handle to the menu assigned to the window. This function is not supported on WinCE.
GetNextDlgGroupItem
CWnd* GetNextDlgGroupItem(CWnd* pCtl, BOOL bPrevious) const;
Retrieves a handle to the first control in a group of controls that precedes (or follows) the specified control in a dialog box.
GetNextDlgTabItem
CWnd* GetNextDlgTabItem(CWnd* pCtl, BOOL bPrevious) const;
Retrieves a handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control.
GetParent
CWnd* GetParent() const;
Retrieves a pointer to the window's parent or owner (if any). This pointer might be temporary, so don't save it for later use.
GetScrollInfo
BOOL GetScrollInfo(int fnBar, SCROLLINFO& si) const;
Retrieves the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb).
GetScrollPos
int GetScrollPos(int nBar) const;
Retrieves the current position of the scroll box (thumb) in the specified scroll bar. The current position is a relative value that depends on the current scrolling range. For example, if the scrolling range is 0 through 100 and the scroll box is in the middle of the bar, the current position is 50. This function is not supported on WinCE.  New applications should use the GetScrollInfo function.
GetScrollRange
BOOL GetScrollRange(int nBar, int& MinPos, int& MaxPos) const;
Retrieves the current minimum and maximum scroll box (thumb) positions for the specified scroll bar. This function is not supported on WinCE.  New applications should use the GetScrollInfo function.
GetSystemMenu
CMenu* GetSystemMenu(BOOL bRevert) const;
Allows the application to access the window menu (also known as the system menu or the control menu) for copying and modifying. This function is not supported on WinCE.
GetTopWindow
CWnd* GetTopWindow() const;
Retrieves a pointer to the child window at the top of the Z order. This pointer might be temporary, so don't save it for later use.
GetUpdateRect
CRect GetUpdateRect(BOOL bErase) const;
Retrieves the coordinates of the smallest rectangle that completely encloses the update region of the specified window.
GetUpdateRgn
int GetUpdateRgn(CRgn* pRgn, BOOL bErase) const;
Retrieves the update region of a window by copying it into the specified region.
GetWindow
CWnd* GetWindow(UINT uCmd) const;
Retrieves a pointer to a window that has the specified relationship (Z-Order or owner) to the window. This pointer might be temporary, so don't save it for later use.
GetWindowDC
CDC* GetWindowDC() const;
Retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area.
GetWindowLongPtr
LONG_PTR GetWindowLongPtr(int nIndex) const;
Retrieves information about the window. The function also retrieves the value at a specified offset into the extra window memory.
GetWindowPlacement
BOOL GetWindowPlacement(WINDOWPLACEMENT& pWndpl) const;
Retrieves the show state and the restored, minimized, and maximized positions of the window. This function is not supported on WinCE.
GetWindowRect
CRect GetWindowRect() const;
Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
GetWindowText
LPCTSTR GetWindowText() const;
Retrieves the title or text associated with the window.
GetWindowTextLength
int GetWindowTextLength() const;
Retrieves the length, in characters, of the specified window's text.
HiliteMenuItem
BOOL HiliteMenuItem(CMenu* pMenu, UINT uItemHilite, UINT uHilite) const;
Highlights or removes the highlighting from an item in a menu bar. This function is not supported on WinCE.
InvalidateRect
BOOL InvalidateRect(LPCRECT lpRect, BOOL bErase = TRUE) const;
The InvalidateRect function adds a rectangle to the window's update region. The update region represents the portion of the window's client area that must be redrawn.
InvalidateRgn
BOOL InvalidateRgn(CRgn* pRgn, BOOL bErase = TRUE) const;
The InvalidateRgn function invalidates the client area within the specified region by adding it to the current update region of a window. The invalidated region, along with all other areas in the update region, is marked for painting when the next WM_PAINT message occurs.
IsChild
BOOL IsChild(CWnd* pChild) const;
Tests whether a window is a child window or descendant window of a specified parent window. A child window is the direct descendant of a specified parent window if that parent window is in the chain of parent windows; the chain of parent windows leads from the original overlapped or pop-up window to the child window.
IsDialogMessage
BOOL IsDialogMessage(LPMSG lpMsg) const;
Determines whether a message is intended for the specified dialog box and, if it is, processes the message.
IsDlgButtonChecked
UINT IsDlgButtonChecked(int nIDButton) const;
Determines whether a button control has a check mark next to it or whether a three-state button control is grayed, checked, or neither.
IsIconic
BOOL IsIconic() const;
Determines whether the window is minimized (iconic). This function is not supported on WinCE.
IsWindow
BOOL IsWindow() const;
Determines whether the window handle identifies an existing window.
IsWindowEnabled
BOOL IsWindowEnabled() const;
Determines whether the window is enabled for mouse and keyboard input.
IsWindowVisible
BOOL IsWindowVisible() const;
Retrieves the visibility state of the window.
IsZoomed
BOOL IsZoomed() const;
Determines whether the window is maximized.  This function is not supported on WinCE.
KillTimer
BOOL KillTimer(UINT_PTR uIDEvent) const;
Destroys the specified timer.
LockWindowUpdate
BOOL LockWindowUpdate() const;
Disables or enables drawing in the window. Only one window can be locked at a time.This function is not supported on WinCE.
MapWindowPoints
void MapWindowPoints(CWnd* pWndTo, POINT& pt) const;
void MapWindowPoints(CWnd* pWndTo, RECT& rc) const;
void MapWindowPoints(CWnd* pWndTo, LPPOINT ptArray, UINT nCount) const;
Converts (maps) a set of points from a coordinate space relative to one window to a coordinate space relative to another window.
MessageBox
int MessageBox(LPCTSTR lpText, LPCTSTR lpCaption, UINT uType) const;
Creates, displays, and operates a message box. The message box contains an application-defined message and title, plus any combination of predefined icons and push buttons.
MoveWindow
BOOL MoveWindow(int x, int y, int nWidth, int nHeight, 
                BOOL bRepaint = TRUE) const;
BOOL MoveWindow(const RECT& rc, BOOL bRepaint = TRUE) const;
The MoveWindow function changes the position and dimensions of the window.
OpenIcon
BOOL OpenIcon() const;
Restores a minimized (iconic) window to its previous size and position, and then activates the window.
PostMessage
BOOL PostMessage(UINT uMsg, WPARAM wParam = 0L, LPARAM lParam = 0L) const;
BOOL PostMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) const;
The PostMessage function places (posts) a message in the message queue associated with the thread that created the window and returns without waiting for the thread to process the message.
Print
void Print(CDC* pDC, DWORD dwFlags) const;
Requests that the window draw itself in the specified device context, most commonly in a printer device context. This function is not supported on WinCE.
RedrawWindow
BOOL RedrawWindow(LPCRECT lpRectUpdate = NULL, CRgn* pRgn = NULL, 
                  UINT flags = RDW_INVALIDATE | RDW_UPDATENOW | 
                  RDW_ERASE | RDW_ALLCHILDREN) const;
This function updates the specified rectangle or region in a window's client area.
ReleaseDC
int ReleaseDC(CDC* pDC) const;
Releases a device context (DC), freeing it for use by other applications.
ScreenToClient
BOOL ScreenToClient(POINT& Point) const;
BOOL ScreenToClient(RECT& rc) const;
Converts the screen coordinates of a specified RECT or points on the screen to client-area coordinates.
ScrollWindow
BOOL ScrollWindow(int XAmount, int YAmount, LPCRECT prcScroll, 
                  LPCRECT prcClip) const;
Scrolls the contents of the specified window's client area. This function is not supported on WinCE. New applications should use the ScrollWindowEx function.
ScrollWindowEx
int ScrollWindowEx(int dx, int dy, LPCRECT prcScroll, LPCRECT prcClip, 
                   CRgn* prgnUpdate, LPRECT prcUpdate, UINT flags) const;
Scrolls the contents of the specified window's client area. This function is not supported on WinCE.
SendDlgItemMessage
LRESULT SendDlgItemMessage(int nIDDlgItem, UINT Msg, 
                           WPARAM wParam, LPARAM lParam) const;
Sends a message to the specified control in a dialog box.
SendMessage
LRESULT SendMessage(UINT uMsg, WPARAM wParam = 0L, 
                    LPARAM lParam = 0L) const;
LRESULT SendMessage(HWND hWnd, UINT uMsg, WPARAM wParam, 
	           LPARAM lParam) const;
The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the window and does not return until the window procedure has processed the message.
SendNotifyMessage
BOOL SendNotifyMessage(UINT Msg, WPARAM wParam, LPARAM lParam) const;
Sends the specified message to a window or windows. If the window was created by the calling thread, SendNotifyMessage calls the window procedure for the window and does not return until the window procedure has processed the message. If the window was created by a different thread, SendNotifyMessage passes the message to the window procedure and returns immediately; it does not wait for the window procedure to finish processing the message.
SetActiveWindow
CWnd* SetActiveWindow() const;
Activates a window.  The window will be brought into the foreground (top of Z-Order) if its application is in the foreground when the system activates the window.
SetCapture
CWnd* SetCapture() const;
Sets the mouse capture to the window belonging to the current thread. SetCapture captures mouse input either when the mouse is over the capturing window, or when the mouse button was pressed while the mouse was over the capturing window and the button is still down. Only one window at a time can capture the mouse.
SetClassLongPtr
ULONG_PTR SetClassLongPtr(int nIndex, LONG_PTR dwNewLong) const;
Replaces the specified value at the specified offset in the extra class memory or the WNDCLASSEX structure for the class to which the window belongs.
SetDlgItemInt
BOOL SetDlgItemInt(int nIDDlgItem, UINT uValue, BOOL bSigned) const;
Sets the text of a control in a dialog box to the string representation of a specified integer value.
SetDlgItemText
BOOL SetDlgItemText(int nIDDlgItem, LPCTSTR lpString) const;
Sets the title or text of a control in a dialog box.
SetFocus
CWnd* SetFocus() const;
Sets the keyboard focus to the window.
SetFont
void SetFont(CFont pFont, BOOL bRedraw) const;;
Specifies the font that a window will use when drawing text.
SetForegroundWindow
BOOL SetForegroundWindow() const;
Puts the thread that created the window into the foreground and activates the window. Keyboard input is directed to the window, and various visual cues are changed for the user. The system assigns a slightly higher priority to the thread that created the foreground window than it does to other threads.
SetIcon
HICON SetIcon(HICON hIcon, BOOL bBigIcon) const;
Associates a new large or small icon with the window..
SetMenu
BOOL SetMenu(CMenu* pMenu) const;
Assigns a new menu to the window. This function is not supported on WinCE.
SetParent
CWnd* SetParent(CWnd* pWndParent) const;
Changes the parent window of the specified child window.
SetRedraw
BOOL SetRedraw(BOOL bRedraw = TRUE) const;
This function allows changes in the window to be redrawn or prevents changes in the window from being redrawn, by sending a WM_SETREDRAW message.
SetScrollInfo
int SetScrollInfo(int fnBar, const SCROLLINFO& si, BOOL fRedraw) const;
Sets the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb). The function also redraws the scroll bar, if requested.
SetScrollPos
int SetScrollPos(int nBar, int nPos, BOOL bRedraw) const;
Sets the position of the scroll box (thumb) in the specified scroll bar and, if requested, redraws the scroll bar to reflect the new position of the scroll box. New applications should use the SetScrollInfo function.  This function is not supported on WinCE.
SetScrollRange
BOOL SetScrollRange(int nBar, int nMinPos, int nMaxPos, 
                    BOOL bRedraw) const;
Sets the minimum and maximum scroll box positions for the specified scroll bar. New applications should use the SetScrollInfo function.  This function is not supported on WinCE.
SetTimer
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT uElapse, 
                  TIMERPROC lpTimerFunc) const;
Creates a timer with the specified time-out value.
SetWindowLongPtr
LONG_PTR SetWindowLongPtr(int nIndex, LONG_PTR dwNewLong) const;
Changes an attribute of the window. The function also sets a value at the specified offset in the extra window memory.
SetWindowPlacement
BOOL SetWindowPlacement(const WINDOWPLACEMENT& wndpl) const;
Sets the show state and the restored, minimized, and maximized positions of the window. This function is not supported on WinCE.
SetWindowPos
BOOL SetWindowPos(const CWnd* pInsertAfter, int x, int y,
                  int cx, int cy, UINT uFlags) const;
BOOL SetWindowPos(const CWnd* pInsertAfter, const RECT& rc, 
	         UINT uFlags) const;
Changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.
The pInsertAfter can one of: &wndTop, &wndTopMost, &wndBottom, or &wndNoTopMost.
SetWindowRgn
int SetWindowRgn(CRgn* pRgn, BOOL bRedraw = TRUE) const;
Sets the window region of a window. The window region determines the area within the window where the system permits drawing. The system does not display any portion of a window that lies outside of the window region. The system owns the region after a successful call to SetWindowRgn.
SetWindowText
BOOL SetWindowText(LPCTSTR lpString) const;
Changes the text of the window's title bar (if it has one). If the window is a control, the text of the control is changed.
SetWindowTheme
HRESULT SetWindowTheme(LPCWSTR pszSubAppName, LPCWSTR pszSubIdList) const;
Causes a window to use a different set of visual style information (XP Theme) than its class normally uses.
ShowOwnedPopups
BOOL ShowOwnedPopups(BOOL fShow) const;
Shows or hides the all the pop-up windows owned by this window.
ShowScrollBar
BOOL ShowScrollBar(int nBar, BOOL bShow) const;
Shows or hides the specified scroll bar. This function is not supported on WinCE.
ShowWindow
BOOL ShowWindow(int nCmdShow = SW_SHOWNORMAL) const;
Sets the window's show state.
ShowWindowAsync
BOOL ShowWindowAsync(int nCmdShow) const;
The ShowWindow function sets the window's show state created in a different thread.
UpdateWindow
BOOL UpdateWindow() const;
Updates the client area of the window by sending a WM_PAINT message to the window if the window's update region is not empty. If the update region is empty, no message is sent.
ValidateRect
BOOL ValidateRect(LPCRECT prc) const;
Validates the client area within a rectangle by removing the rectangle from the update region of the window.
ValidateRgn
BOOL ValidateRgn(CRgn* pRgn) const;
Validates the client area within a region by removing the region from the current update region of the window.
WindowFromDC
CWnd* WindowFromDC(CDC* pDC) const;
Retrieves a pointer to the window associated with the specified device context.  This pointer might be temporary, so don't save it for later use.
WindowFromPoint
static CWnd* WindowFromPoint(POINT pt);
Retrieves the window that contains the specified point (in screen coordinates).

Remarks

Refer to the Simple Window section for information on how to use this class to create a window and handle its messages.

Summary Information

Header file wincore.h
Win32/64 support Yes
WinCE support Yes