共用方式為


CWnd::GetWindow

Returns a pointer to the window requested, or NULL if none.

CWnd* GetWindow(
   UINT nCmd 
) const;

Parameters

  • nCmd
    Specifies the relationship between CWnd and the returned window. It can take one of the following values:

    • GW_CHILD   Identifies the CWnd first child window.

    • GW_HWNDFIRST   If CWnd is a child window, returns the first sibling window. Otherwise, it returns the first top-level window in the list.

    • GW_HWNDLAST   If CWnd is a child window, returns the last sibling window. Otherwise, it returns the last top-level window in the list.

    • GW_HWNDNEXT   Returns the next window on the window manager's list.

    • GW_HWNDPREV   Returns the previous window on the window manager's list.

    • GW_OWNER   Identifies the CWnd owner.

Return Value

The returned pointer may be temporary and should not be stored for later use.

Requirements

Header: afxwin.h

See Also

Reference

CWnd Class

Hierarchy Chart

CWnd::GetParent

CWnd::GetNextWindow

GetWindow