共用方式為


CWindow Members

The following categories of CWindow members are available:

Alert Methods

Data Members

Attribute Methods

Icon Methods

Caret Methods

Menu Methods

Clipboard Methods

Message Methods

Construction, Destruction, and Initialization

Process and Thread Methods

Coordinate Mapping Methods

Timer Methods

Dialog Box Item Methods

Update and Painting Methods

Drag-Drop Methods

Window Access Methods

Font Methods

Window Size and Position Methods

Help Methods

Window State Methods

Window Tree Access Methods

Scrolling Methods

Hot Key Methods

Window Text Methods

Operators

 

Alert Methods

FlashWindow

Flashes the window once.

MessageBox

Displays a message box.

Attribute Methods

GetExStyle

Retrieves the extended window styles.

GetStyle

Retrieves the window styles.

GetWindowLong

Retrieves a 32-bit value at a specified offset into the extra window memory.

GetWindowLongPtr

Retrieves information about the specified window, including a value at a specified offset into the extra window memory.

GetWindowWord

Retrieves a 16-bit value at a specified offset into the extra window memory.

ModifyStyle

Modifies the window styles.

ModifyStyleEx

Modifies the extended window styles.

SetWindowLong

Sets a 32-bit value at a specified offset into the extra window memory.

SetWindowLongPtr

Changes an attribute of the specified window, and also sets a value at the specified offset in the extra window memory.

SetWindowWord

Sets a 16-bit value at a specified offset into the extra window memory.

Caret Methods

CreateCaret

Creates a new shape for the system caret.

CreateGrayCaret

Creates a gray rectangle for the system caret.

CreateSolidCaret

Creates a solid rectangle for the system caret.

HideCaret

Hides the system caret.

ShowCaret

Displays the system caret.

Clipboard Methods

ChangeClipboardChain

Removes the window from the chain of Clipboard viewers.

OpenClipboard

Opens the Clipboard.

SetClipboardViewer

Adds the window to the Clipboard viewer chain.

Construction, Destruction, and Initialization

Attach

Attaches a window to the CWindow object.

Create

Creates a window.

CWindow

Constructor.

DestroyWindow

Destroys the window associated with the CWindow object.

Detach

Detaches the window from the CWindow object.

Coordinate Mapping Methods

ClientToScreen

Converts client coordinates to screen coordinates.

MapWindowPoints

Converts a set of points from the window's coordinate space to the coordinate space of another window.

ScreenToClient

Converts screen coordinates to client coordinates.

Dialog Box Item Methods

CheckDlgButton

Changes the check state of the specified button.

CheckRadioButton

Checks the specified radio button.

DlgDirList

Fills a list box with the names of all files matching a specified path or file name.

DlgDirListComboBox

Fills a combo box with the names of all files matching a specified path or file name.

DlgDirSelect

Retrieves the current selection from a list box.

DlgDirSelectComboBox

Retrieves the current selection from a combo box.

GetDlgControl

Retrieves an interface on the specified control.

GetDlgHost

Retrieves a pointer to an interface to the ATL Control hosting container.

GetDlgItemInt

Translates a control's text to an integer.

GetDlgItemText

Retrieves a control's text.

GetNextDlgGroupItem

Retrieves the previous or next control within a group of controls.

GetNextDlgTabItem

Retrieves the previous or next control having the WS_TABSTOP style.

GotoDlgCtrl

Sets the keyboard focus to a control in the dialog box.

IsDialogMessage

Determines whether a message is intended for the specified dialog box.

IsDlgButtonChecked

Determines the check state of the button.

NextDlgCtrl

Sets the keyboard focus to the next control in the dialog box.

PrevDlgCtrl

Sets the keyboard focus to the previous control in the dialog box.

SendDlgItemMessage

Sends a message to a control.

SetDlgItemInt

Changes a control's text to the string representation of an integer value.

SetDlgItemText

Changes a control's text.

Drag-Drop Methods

DragAcceptFiles

Registers whether the window accepts dragged files.

Font Methods

GetFont

Retrieves the window's current font.

SetFont

Changes the window's current font.

Help Methods

GetWindowContextHelpId

Retrieves the window's help context identifier.

SetWindowContextHelpId

Sets the window's help context identifier.

WinHelp

Starts Windows Help.

Hot Key Methods

GetHotKey

Determines the hot key associated with the window.

SetHotKey

Associates a hot key with the window.

Icon Methods

GetIcon

Retrieves the window's large or small icon.

SetIcon

Changes the window's large or small icon.

Menu Methods

DrawMenuBar

Redraws the window's menu bar.

GetMenu

Retrieves the window's menu.

GetSystemMenu

Creates a copy of the system menu for modification.

HiliteMenuItem

Highlights or removes the highlight from a top-level menu item.

SetMenu

Changes the window's current menu.

Message Methods

PostMessage

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.

SendMessage

Sends a message to the window and does not return until the window procedure has processed the message.

SendNotifyMessage

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.

Process and Thread Methods

GetWindowProcessID

Retrieves the identifier of the process that created the window.

GetWindowThreadID

Retrieves the identifier of the thread that created the specified window.

Scrolling Methods

EnableScrollBar

Enables or disables the scroll bar arrows.

GetScrollInfo

Retrieves the parameters of a scroll bar.

GetScrollPos

Retrieves the position of the scroll box.

GetScrollRange

Retrieves the scroll bar range.

ScrollWindow

Scrolls the specified client area.

ScrollWindowEx

Scrolls the specified client area with additional features.

SetScrollInfo

Sets the parameters of a scroll bar.

SetScrollPos

Changes the position of the scroll box.

SetScrollRange

Changes the scroll bar range.

ShowScrollBar

Shows or hides a scroll bar.

Timer Methods

KillTimer

Destroys a timer event.

SetTimer

Creates a timer event.

Update and Painting Methods

BeginPaint

Prepares the window for painting.

EndPaint

Marks the end of painting.

GetDC

Retrieves a device context for the client area.

GetDCEx

Retrieves a device context for the client area and allows clipping options.

GetUpdateRect

Retrieves the coordinates of the smallest rectangle that completely encloses the update region.

GetUpdateRgn

Retrieves the update region and copies it into a specified region.

GetWindowDC

Retrieves a device context for the entire window.

Invalidate

Invalidates the entire client area.

InvalidateRect

Invalidates the client area within the specified rectangle.

InvalidateRgn

Invalidates the client area within the specified region.

IsWindowVisible

Determines the window's visibility state.

LockWindowUpdate

Disables or enables drawing in the window.

Print

Requests that the window be drawn in a specified device context.

PrintClient

Requests that the window's client area be drawn in a specified device context.

RedrawWindow

Updates a specified rectangle or region in the client area.

ReleaseDC

Releases a device context.

SetRedraw

Sets or clears the redraw flag.

ShowOwnedPopups

Shows or hides the pop-up windows owned by the window.

ShowWindow

Sets the window's show state.

ShowWindowAsync

Sets the show state of a window created by a different thread.

UpdateWindow

Updates the client area.

ValidateRect

Validates the client area within the specified rectangle.

ValidateRgn

Validates the client area within the specified region.

Window Access Methods

ChildWindowFromPoint

Retrieves the child window containing the specified point.

ChildWindowFromPointEx

Retrieves a particular type of child window containing the specified point.

GetLastActivePopup

Retrieves the most recently active pop-up window.

GetParent

Retrieves the immediate parent window.

GetTopLevelParent

Retrieves the top-level parent or owner window.

GetTopLevelWindow

Retrieves the top-level owner window.

GetTopWindow

Retrieves the top-level child window.

GetWindow

Retrieves the specified window.

IsChild

Determines whether the specified window is a child window.

SetParent

Changes the parent window.

Window Size and Position Methods

ArrangeIconicWindows

Arranges all minimized child windows.

BringWindowToTop

Brings the window to the top of the Z order.

CenterWindow

Centers the window against a given window.

DeferWindowPos

Updates the specified multiple-window-position structure for the specified window.

GetClientRect

Retrieves the coordinates of the client area.

GetWindowPlacement

Retrieves the show state and positions.

GetWindowRect

Retrieves the window's bounding dimensions.

GetWindowRgn

Obtains a copy of the window region of a window.

IsIconic

Determines whether the window is minimized.

IsZoomed

Determines whether the window is maximized.

MoveWindow

Changes the window's size and position.

ResizeClient

Resizes the window.

SetWindowPlacement

Sets the show state and positions.

SetWindowPos

Sets the size, position, and Z order.

SetWindowRgn

Sets the window region of a window.

Window State Methods

EnableWindow

Enables or disables input.

IsParentDialog

Determines if the parent window of a control is a dialog window.

IsWindowEnabled

Determines whether the window is enabled for input.

IsWindowUnicode

Determines whether the specified window is a native Unicode window.

IsWindow

Determines whether the specified window handle identifies an existing window.

SetActiveWindow

Activates the window.

SetCapture

Sends all subsequent mouse input to the window.

SetFocus

Sets the input focus to the window.

Window Text Methods

GetWindowText

Retrieves the window's text.

GetWindowTextLength

Retrieves the length of the window's text.

SetWindowText

Changes the window's text.

Window Tree Access Methods

GetDescendantWindow

Retrieves the specified descendant window.

GetDlgCtrlID

Retrieves the window's identifier (for child windows only).

GetDlgItem

Retrieves the specified child window.

SendMessageToDescendants

Sends a message to the specified descendant windows.

SetDlgCtrlID

Changes the window's identifier.

Operators

operator =

Assigns an HWND to the CWindow object.

operator HWND

Converts the CWindow object to an HWND.

Data Members

m_hWnd

The handle to the window associated with the CWindow object.

rcDefault

Contains default window dimensions.

See Also

Reference

CWindow Class