CMDIChildWndEx Class

 

The CMDIChildWndEx class provides the functionality of a Windows multiple document interface (MDI) child window. It extends the functionality of CMDIChildWnd Class. The framework requires this class when an MDI application uses certain MFC classes.

class CMDIChildWndEx : public CMDIChildWnd  

Public Methods

NameDescription
CMDIChildWndEx::ActivateTopLevelFrameCalled internally by the framework to activate top level frame when the application should be activated from a taskbar tab.
CMDIChildWndEx::AddDockSiteThis method is not used or implemented.
CMDIChildWndEx::AddPaneAdds a pane.
CMDIChildWndEx::AddTabbedPaneAdds a tabbed pane.
CMDIChildWndEx::AdjustDockingLayoutAdjusts the docking layout.
CMDIChildWndEx::CanShowOnMDITabs
CMDIChildWndEx::CanShowOnTaskBarTabsTells the framework whether this MDI child can be displayed on Windows 7 taskbar tabs.
CMDIChildWndEx::CanShowOnWindowsListReturns TRUE if the MDI child window name can be displayed in the CMFCWindowsManagerDialog Class dialog box. Otherwise returns FALSE.
CMDIChildWndEx::CreateObjectCalled by the framework to create a dynamic instance of this class type.
CMDIChildWndEx::DockPaneDocks a pane.
CMDIChildWndEx::DockPaneLeftOfDocks one pane to the left of another pane.
CMDIChildWndEx::EnableAutoHidePanesEnables auto-hide mode for panes when they are docked at the specified sides of the window.
CMDIChildWndEx::EnableDockingEnables docking of the child window to the main frame.
CMDIChildWndEx::EnableTaskbarThumbnailClipRectEnables or disables automatic selection of a portion of a window's client area to display as that window's thumbnail in the taskbar.
CMDIChildWndEx::GetDockingManager
CMDIChildWndEx::GetDocumentNameReturns the name of the document that is displayed in the MDI child window.
CMDIChildWndEx::GetFrameIconCalled by the framework to retrieve the MDI child window icon.
CMDIChildWndEx::GetFrameTextCalled by the framework to retrieve the text for the MDI child window.
CMDIChildWndEx::GetPaneFinds a pane by the specified control ID.
CMDIChildWndEx::GetRelatedTabGroup
CMDIChildWndEx::GetTabbedPaneReturns a pointer to an embedded docking pane that was converted to a tabbed document.
CMDIChildWndEx::GetTabProxyWndReturns tab proxy window actually registered with Windows 7 taskbar tabs.
CMDIChildWndEx::GetTaskbarPreviewWndCalled by the framework when it needs to obtain a child window (usually a view or splitter window) to be displayed on Windows 7 taskbar tab thumbnail.
CMDIChildWndEx::GetTaskbarThumbnailClipRectCalled by the framework when it needs to select a portion of a window's client area to display as that window's thumbnail in the taskbar.
CMDIChildWndEx::GetThisClassCalled by the framework to obtain a pointer to the CRuntimeClass object that is associated with this class type.
CMDIChildWndEx::GetToolbarButtonToolTipTextCalled by the framework to retrieve a tooltip for a toolbar button.
CMDIChildWndEx::InsertPaneRegisters the specified pane with the docking manager.
CMDIChildWndEx::InvalidateIconicBitmapsInvalidates iconic bitmap representation of MDI child.
CMDIChildWndEx::IsPointNearDockSiteDetermines whether a specified point is near the dock site.
CMDIChildWndEx::IsReadOnlyReturns TRUE if the document that is displayed in the child window is read-only. Otherwise returns FALSE.
CMDIChildWndEx::IsRegisteredWithTaskbarTabsReturns TRUE if MDI child was successfully registered with Windows 7 taskbar tabs.
CMDIChildWndEx::IsTabbedPaneReturns TRUE if the MDI child window contains a docking pane. Otherwise returns FALSE.
CMDIChildWndEx::IsTaskbarTabsSupportEnabledTells whether the MDI child can appear on Windows 7 taskbar tabs.
CMDIChildWndEx::IsTaskbarThumbnailClipRectEnabledTells whether automatic selection of a portion of a window's client area to display as that window's thumbnail in the taskbar is enabled or disabled.
CMDIChildWndEx::m_dwDefaultTaskbarTabPropertyFlagsA combination of flags, which is passed by the framework to the SetTaskbarTabProperties method, when a tab (MDI child) is being registered with Windows 7 taskbar tabs. The default combination is STPF_USEAPPTHUMBNAILWHENACTIVE | STPF_USEAPPPEEKWHENACTIVE.
CMDIChildWndEx::OnGetIconicLivePreviewBitmapCalled by the framework when it needs to obtain a bitmap for live preview of MDI child.
CMDIChildWndEx::OnGetIconicThumbnailCalled by the framework when it needs to obtain a bitmap for iconic thumbnail of MDI child.
CMDIChildWndEx::OnMoveMiniFrameCalled by the framework to move a mini-frame window.
CMDIChildWndEx::OnPressTaskbarThmbnailCloseButtonCalled by the framework when the user presses close button on Taskbar tab thumbnail..
CMDIChildWndEx::OnSetPreviewModeCalled by the framework to enter or exit print preview mode.
CMDIChildWndEx::OnTaskbarTabThumbnailActivateCalled by the framework when the Taskbar tab thumbnail should process WM_ACTIVATE message.
CMDIChildWndEx::OnTaskbarTabThumbnailMouseActivateCalled by the framework when the Taskbar tab thumbnail should process WM_MOUSEACTIVATE message.
CMDIChildWndEx::OnTaskbarTabThumbnailStretchCalled by the framework when it needs to stretch a bitmap for Windows 7 taskbar tab thumbnail preview of MDI child.
CMDIChildWndEx::OnUpdateFrameTitleCalled by the framework to update the frame title. (Overrides CMDIChildWnd::OnUpdateFrameTitle.)
CMDIChildWndEx::PaneFromPointReturns the pane that contains the given point.
CMDIChildWndEx::PreTranslateMessageUsed by class CWinApp to translate window messages before they are dispatched to the TranslateMessage and DispatchMessage Windows functions. (Overrides CWnd::PreTranslateMessage.)
CMDIChildWndEx::RecalcLayoutRecalculates the layout of the window.
CMDIChildWndEx::RegisterTaskbarTabRegisters MDI child with Windows 7 taskbar tabs.
CMDIChildWndEx::RemovePaneFromDockManagerRemoves a pane from the docking manager.
CMDIChildWndEx::SetRelatedTabGroup
CMDIChildWndEx::SetTaskbarTabActiveActivates corresponding Windows 7 taskbar tab.
CMDIChildWndEx::SetTaskbarTabOrderInserts MDI child before specified window on Windows 7 taskbar tabs.
CMDIChildWndEx::SetTaskbarTabPropertiesSets properties for a Windows 7 taskbar tab.
CMDIChildWndEx::SetTaskbarThumbnailClipRectCalled internally by the framework to set clipping rectangle to select a portion of a window's client area to display as that window's thumbnail in the taskbar.
CMDIChildWndEx::ShowPane
CMDIChildWndEx::UnregisterTaskbarTabRemoves MDI child from Windows 7 taskbar tabs.
CMDIChildWndEx::UpdateTaskbarTabIconUpdates Windows 7 taskbar tab icon.

To take advantage of extended docking features in MDI applications, derive the MDI child window class of your application from CMDIChildWndEx instead of CMDIChildWnd.

The following example derives a class from CMDIChildWndEx. This code snippet comes from the VisualStudioDemo Sample: MFC Visual Studio Application.

class CChildFrame : public CMDIChildWndEx
{
	DECLARE_DYNCREATE(CChildFrame)
public:
	CChildFrame();

// Overrides
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void ActivateFrame(int nCmdShow = -1);

	virtual BOOL IsReadOnly();
	virtual LPCTSTR GetDocumentName(CObject** pObj);

// Implementation
public:
	virtual ~CChildFrame();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

	DECLARE_MESSAGE_MAP()
};

CObject

CCmdTarget

CWnd

CFrameWnd

CMDIChildWnd

CMDIChildWndEx

Header: afxMDIChildWndEx.h

Adds a pane.

BOOL AddPane(
    CBasePane* pControlBar,  
    BOOL bTail = TRUE);

Parameters

[in] pControlBar
A pointer to the pane.

[in] bTail
TRUE to add the pane to the end of the list of panes for the docking manager; otherwise, FALSE.

Return Value

TRUE if the pane was successfully registered with the docking manager; otherwise, FALSE.

Adds a tabbed pane.

void AddTabbedPane(CDockablePane* pControlBar);

Parameters

[in] pControlBar
A pointer to the pane.

Adjusts the docking layout.

virtual void AdjustDockingLayout(HDWP hdwp = NULL);

Parameters

[in] hdwp
Handle to a deferred window position structure.

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

virtual BOOL CanShowOnMDITabs();

Return Value

Remarks

Specifies whether the MDI child window name can be displayed in the CMFCWindowsManagerDialog Class dialog box.

virtual BOOL CanShowOnWindowsList();

Return Value

TRUE if the window can be displayed in the Windows dialog box; otherwise, FALSE.

Remarks

Override this method in a derived class and return FALSE if the window should not be displayed in the Windows dialog box. This function is called from CMFCWindowsManagerDialog.

Docks a pane.

void DockPane(
    CBasePane* pBar,  
    UINT nDockBarID = 0,  
    LPCRECT lpRect = NULL);

Parameters

[in] pBar
A pointer to the pane.

[in] nDockBarID
The ID of the pane.

[in] lpRect
A pointer to a rectangle.

Remarks

The lpRect parameter is not used.

Docks one pane to the left of another pane.

BOOL DockPaneLeftOf(
    CPane* pBar,  
    CPane* pLeftOf);

Parameters

pBar
A pointer to the pane that is to be docked.

pLeftOf
A pointer to the pane that serves as the point of reference.

Return Value

TRUE on success, FALSE on failure.

Remarks

This method takes the pane specified by pBar and docks it at the left side of the pane specified by pLeftOf.

Call this method when you want to dock several panes in predefined order.

Enables auto-hide mode for panes when they are docked at the specified sides of the window.

BOOL EnableAutoHidePanes(DWORD dwDockStyle);

Parameters

[in] dwDockStyle
Specifies the sides of the main frame window that is enabled. Use one or more of the following flags.

  • CBRS_ALIGN_LEFT

  • CBRS_ALIGN_RIGHT

  • CBRS_ALIGN_TOP

  • CBRS_ALIGN_BOTTOM

Return Value

TRUE if the method succeeds; otherwise FALSE.

Enables docking of the child window to the main frame.

BOOL EnableDocking(DWORD dwDockStyle);

Parameters

[in] dwDockStyle
Specifies the docking alignment to enable.

Return Value

TRUE if the method succeeds; otherwise FALSE.

Remarks

Call this method to enable docking alignment to the main frame. You can pass a combination of CBRS_ALIGN_ flags (for more information, see CControlBar::EnableDocking).

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

CDockingManager* GetDockingManager();

Return Value

Remarks

Returns the name of the document that is displayed in the MDI child window.

virtual LPCTSTR GetDocumentName(CObject** pObj);

Return Value

A pointer to a string that contains the name of a document.

Remarks

A document is what the MDI child window displays. Generally, the window displays data that is loaded from or saved to a file. Therefore, the name of the document is the name of the file. The default implementation of GetDocumentName returns a string obtained from CDocument::GetPathName.

If the window displays a document that is not loaded from a file, override this method in a derived class and return a unique document identifier.

GetDocumentName is called by the framework when it saves the state of all opened documents. The returned string is written to the registry.

When the framework is restoring state later, the document name is read from the registry and passed to CMDIFrameWndEx::CreateDocumentWindow. Override this method in a CMDIFrameWndEx-derived class and create or open a document that has this name and read in the file that has this name. If the document is not based on a file, create the document based on the document identifier itself. You should do the preceding actions only if you intend to save and restore documents.

Example

The following example demonstrates the use of the GetDocumentName method. This code snippet comes from the VisualStudioDemo Sample: MFC Visual Studio Application.

LPCTSTR CChildFrame::GetDocumentName(CObject** pObj)
{
	if (DYNAMIC_DOWNCAST(CStartView, GetActiveView()) != NULL)
	{
		return g_strStartViewName;
	}
	return CMDIChildWndEx::GetDocumentName(pObj);
}

Called by the framework to retrieve the icon of the MDI child window.

virtual HICON GetFrameIcon() const;

 

Return Value

A handle to the window icon.

Remarks

This method is called by the framework to determine what icon to display on the MDI tab that contains the MDI child frame window.

By default this method returns the window icon. Override GetFrameIcon in a CMDIChildWndEx-derived class to customize this behavior.

Called by the framework to retrieve the text for the MDI child window.

virtual CString GetFrameText() const;

 

Return Value

A string that contains the frame window text.

Remarks

This method is called by the framework to determine what text to display on the MDI tab that contains the MDI child frame window.

By default this method returns the window text. Override GetFrameText in a CMDIChildWndEx-derived class to customize this behavior.

Finds a pane by the specified control ID.

CBasePane* GetPane(UINT nID);

Parameters

[in] nID
The control ID of the pane to find.

Return Value

A pointer to the pane if found, otherwise NULL.

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

CMFCTabCtrl* GetRelatedTabGroup();

Return Value

Remarks

Returns a pointer to a docking pane that is part of a group of MDI tabbed documents.

CDockablePane* GetTabbedPane() const;

 

Return Value

A pointer to a docking pane that is part of a group of MDI tabbed documents.

Called by the framework to retrieve a tooltip for a toolbar button.

virtual BOOL GetToolbarButtonToolTipText(
    CMFCToolBarButton*, 
    CString&);

Return Value

TRUE if the tooltip has been displayed. The default implementation returns FALSE.

Remarks

Override this method if you want to display custom tool tips for toolbar buttons.

Registers the specified pane with the docking manager.

BOOL InsertPane(
    CBasePane* pControlBar,  
    CBasePane* pTarget,  
    BOOL bAfter = TRUE);

Parameters

[in] pControlBar
A pointer to the pane to insert.

[in] pTarget
A pointer to the adjacent pane.

[in] bAfter
If TRUE, pControlBar is inserted after pTarget. If FALSE, pControlBar is inserted before pTarget.

Return Value

TRUE if the method succeeds, FALSE otherwise.

Determines whether a specified point is near the dock site.

BOOL IsPointNearDockSite(
    CPoint point,  
    DWORD& dwBarAlignment,  
    BOOL& bOuterEdge) const;

 

Parameters

[in] point
The specified point.

[in] dwBarAlignment
Specifies which edge the point is near. Possible values are CBRS_ALIGN_LEFT, CBRS_ALIGN_RIGHT, CBRS_ALIGN_TOP, and CBRS_ALIGN_BOTTOM

[in] bOuterEdge
TRUE if the point is near the outer border of the dock site; FALSE otherwise.

Return Value

TRUE if the point is near the dock site; otherwise FALSE.

Remarks

The point is near the dock site when it is within the sensitivity set in the docking manager. The default sensitivity is 15 pixels.

Specifies whether the document that is displayed in the child window is read-only.

virtual BOOL IsReadOnly();

Return Value

TRUE if the document is read-only; otherwise FALSE.

Remarks

This function is used to prevent saving of read-only documents.

Example

The following example demonstrates overriding the IsReadOnly method. This code snippet comes from the VisualStudioDemo Sample: MFC Visual Studio Application.

BOOL CChildFrame::IsReadOnly()
{
	return DYNAMIC_DOWNCAST(CStartView, GetActiveView()) != NULL;
}

Specifies whether the MDI child window contains a docking pane.

BOOL IsTabbedPane() const;

 

Return Value

TRUE if the MDI child window contains a docking pane that was converted to a tabbed document; otherwise FALSE.

Called by the framework to move a mini-frame window.

virtual BOOL OnMoveMiniFrame(CWnd* pFrame);

Parameters

[in] pFrame
A pointer to a mini-frame window.

Return Value

TRUE if the method succeeds, otherwise FALSE.

Called by the framework to enter or exit print preview mode.

virtual void OnSetPreviewMode(
    BOOL bPreview,  
    CPrintPreviewState* pState);

Parameters

[in] bPreview
If TRUE, enter print preview mode. If FALSE, exit print preview mode.

[in] pState
A pointer to the print preview state structure.

Called by the framework to update the frame title.

virtual void OnUpdateFrameTitle(BOOL bAddToTitle);

Parameters

[in] bAddToTitle
If TRUE, add the document name to the title.

Returns the pane that contains the given point.

CBasePane* PaneFromPoint(
    CPoint point,  
    int nSensitivity,  
    bool bExactBar,  
    CRuntimeClass* pRTCBarType) const;

 
CBasePane* PaneFromPoint(
    CPoint point,  
    int nSensitivity,  
    DWORD& dwAlignment,  
    CRuntimeClass* pRTCBarType) const;

 

Parameters

[in] point
Specifies the point, in screen coordinates, to check.

[in] nSensitivity
Increase the search area by this amount. A pane satisfies the search criteria if the given point falls in the increased area.

[in] bExactBar
TRUE to ignore the nSensitivity parameter; otherwise, FALSE.

[in] pRTCBarType
If not NULL, the method searches only panes of the specified type.

[in] dwAlignment
If a pane is found at the specified point, this parameter contains the side of the pane that was closest to the specified point. For more information, see the Remarks section.

Return Value

A pointer to the CBasePane-derived object that contains the given point, or NULL if no pane was found.

Remarks

Call this method to determine whether a pane contains the specified point according to the specified conditions such as runtime class and visibility.

When the function returns and a pane was found, dwAlignment contains the alignment of the specified point. For example, if the point was closest to the top of the pane, dwAlignment is set to CBRS_ALIGN_TOP.

Recalculates the layout of the window.

virtual void RecalcLayout(BOOL bNotify = TRUE);

Parameters

[in] bNotify
If TRUE, the active in-place item for the window receives notification of the layout change.

Removes a pane from the docking manager.

void RemovePaneFromDockManager(
    CBasePane* pControlBar,  
    BOOL bDestroy,  
    BOOL bAdjustLayout,  
    BOOL bAutoHide,  
    CBasePane* pBarReplacement);

Parameters

[in] pControlBar
A pointer to the pane to remove.

[in] bDestroy
If TRUE, the removed pane is destroyed.

[in] bAdjustLayout
If TRUE, adjust the docking layout immediately.

[in] bAutoHide
If TRUE, the docking layout is related to the list of autohide bars. If FALSE, the docking layout is related to the list of regular panes.

[in] pBarReplacement
A pointer to a pane that replaces the removed pane.

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

void SetRelatedTabGroup(CMFCTabCtrl* p);

Parameters

[in] p

Remarks

This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.

void ShowPane(
    CBasePane* pBar,  
    BOOL bShow,  
    BOOL bDelay,  
    BOOL bActivate);

Parameters

[in] pBar
[in] bShow
[in] bDelay
[in] bActivate

Remarks

Updates the Windows 7 taskbar tab icon.

virtual void UpdateTaskbarTabIcon(HICON hIcon);

Parameters

hIcon
A handle to an icon to display on the Windows 7 taskbar tab.

Remarks

Removes the MDI child from Windows 7 taskbar tabs.

void UnregisterTaskbarTab(BOOL bCheckRegisteredMDIChildCount = TRUE);

Parameters

bCheckRegisteredMDIChildCount
Specifies whether this function needs to check the number of MDI children registered with MDI tabs. If this number is 0, then this function removes the clipping rectangle from the application's taskbar thumbnail.

Remarks

Called by the framework to set the clipping rectangle to select a portion of a window's client area to display as that window's thumbnail in the taskbar.

virtual BOOL SetTaskbarThumbnailClipRect(CRect rect);

Parameters

rect
Specifies the new clipping rectangle. If the rectangle is empty or null, the clipping is removed.

Return Value

TRUE if successful; otherwise FALSE.

Remarks

Sets properties for a Windows 7 taskbar tab.

void SetTaskbarTabProperties(DWORD dwFlags);

Parameters

dwFlags
A combination of STPFLAG values. For more information, see ITaskbarList4::SetTabProperties.

Remarks

Inserts the MDI child before the specified window on Windows 7 taskbar tabs.

void SetTaskbarTabOrder(CMDIChildWndEx* pWndBefore = NULL);

Parameters

pWndBefore
A pointer to the MDI child window whose thumbnail is inserted to the left. This window must already be registered through RegisterTaskbarTab. If this value is NULL, the new thumbnail is added to the end of the list.

Remarks

Activates the corresponding Windows 7 taskbar tab.

void SetTaskbarTabActive();

Remarks

Registers the MDI child with Windows 7 taskbar tabs.

virtual void RegisterTaskbarTab(CMDIChildWndEx* pWndBefore = NULL);

Parameters

pWndBefore
A pointer to the MDI child window whose thumbnail is inserted to the left. This window must already be registered through RegisterTaskbarTab. If this value is NULL, the new thumbnail is added to the end of the list.

Remarks

Called by the framework when it needs to stretch a bitmap for a Windows 7 taskbar tab thumbnail preview of the MDI child.

virtual BOOL OnTaskbarTabThumbnailStretch(
    HBITMAP hBmpDst,  
    const CRect& rectDst,  
    HBITMAP hBmpSrc,  
    const CRect& rectSrc);

Parameters

hBmpDst
A handle to a destination bitmap.

rectDst
Specifies the destination rectangle.

hBmpSrc
A handle to a source bitmap.

rectSrc
Specifies the source rectangle.

Remarks

Requirementher or him him him him him him him : afxmdichildwndex.h

Called by the framework when the Taskbar tab thumbnail should process the WM_MOUSEACTIVATE message.

virtual int OnTaskbarTabThumbnailMouseActivate(
    CWnd* pDesktopWnd,  
    UINT nHitTest,  
    UINT message);

Parameters

pDesktopWnd
Specifies a pointer to the top-level parent window of the window being activated. The pointer may be temporary and should not be stored.

nHitTest
Specifies the hit-test area code. A hit test is a test that determines the location of the cursor.

message
Specifies the mouse message number.

Remarks

The default implementation activates the related MDI child frame.

Called by the framework when the Taskbar tab thumbnail should process the WM_ACTIVATE message.

virtual void OnTaskbarTabThumbnailActivate(
    UINT nState,  
    CWnd* pWndOther,  
    BOOL bMinimized);

Parameters

nState
Specifies whether the CWnd is being activated or deactivated.

pWndOther
Pointer to the CWnd being activated or deactivated. The pointer can be NULL, and it may be temporary.

bMinimized
Specifies the minimized state of the CWnd being activated or deactivated. A value of TRUE indicates the window is minimized.

Remarks

The default implementation activates the related MDI child frame.

Called by the framework when the user presses the close button on the Taskbar tab thumbnail.

virtual void OnPressTaskbarThmbnailCloseButton();

Remarks

Called by the framework when it needs to obtain a bitmap for the iconic thumbnail of the MDI child.

virtual HBITMAP OnGetIconicThumbnail(
    int nWidth,  
    int nHeight);

Parameters

nWidth
Specifies the width of the required bitmap.

nHeight
Specifies the height of the required bitmap.

Remarks

Called by the framework when it needs to obtain a bitmap for live preview of the MDI child.

virtual HBITMAP OnGetIconicLivePreviewBitmap(
    BOOL bIsMDIChildActive,  
    CPoint& ptLocation);

Parameters

bIsMDIChildActive
This parameter is TRUE if the bitmap is requested for the MDI child, which is currently active and the main window is not minimized. The default processing in this case takes a snapshot of the main window.

ptLocation
Specifies the location of the bitmap in the main (top level) window client coordinates. This point should be provided by the callee.

Return Value

If processed, returns a handle to a valid 32bpp bitmap, otherwise NULL.

Remarks

Override this method in a derived class and return a valid 32bpp bitmap for live preview of MDI child. This method is called only when the MDI child is displayed on Windows 7 taskbar tabs. If you return NULL, MFC calls the default handlers and obtains bitmaps using PrintClient or PrintWindow.

A combination of flags, which is passed by the framework to the SetTaskbarTabProperties method, when a tab (MDI child) is being registered with Windows 7 taskbar tabs.

AFX_IMPORT_DATA static DWORD m_dwDefaultTaskbarTabPropertyFlags;  

Remarks

The default combination is STPF_USEAPPTHUMBNAILWHENACTIVE | STPF_USEAPPPEEKWHENACTIVE.

Tells whether automatic selection of a portion of a window's client area to display as that window's thumbnail in the taskbar is enabled or disabled.

BOOL IsTaskbarThumbnailClipRectEnabled() const;

 

Return Value

Returns TRUE if automatic selection of a portion of a window's client area to display is enabled; otherwise FALSE.

Remarks

Tells whether the MDI child can appear on Windows 7 taskbar tabs.

BOOL IsTaskbarTabsSupportEnabled();

Return Value

TRUE if the MDI child can appear on Windows 7 taskbar tabs; FALSE if the MDI child can not appear on Windows 7 taskbar tabs.

Remarks

Returns TRUE if the MDI child was successfully registered with Windows 7 taskbar tabs.

BOOL IsRegisteredWithTaskbarTabs();

Return Value

TRUE if the MDI child is registered with Windows 7 taskbar tabs; otherwise FALSE.

Remarks

Invalidates an iconic bitmap representation of a MDI child.

BOOL InvalidateIconicBitmaps();

Return Value

Returns FALSE if Windows 7 taskbar support is disabled or the MDI child is not registered with Windows 7 taskbar tabs; otherwise returns TRUE.

Remarks

Should be called when the live content or size of a MDI child has changed.

Called by the framework when it needs to select a portion of a window's client area to display as that window's thumbnail in the taskbar.

virtual CRect GetTaskbarThumbnailClipRect() const;

 

Return Value

A rectangle in windows coordinates. This rectangle is mapped to the client area of the top level frame. The rectangle should be empty to clear the clipping rectangle.

Remarks

Called by the framework when it needs to obtain a child window (usually a view or splitter window) to be displayed on a Windows 7 taskbar tab thumbnail.

virtual CWnd* GetTaskbarPreviewWnd();

Return Value

Should return a valid pointer to a CWnd object, whose preview should be displayed on a Windows 7 taskbar tab related to this MDI child. The default implementation returns a child window of this MDI child with AFX_IDW_PANE_FIRST control ID (which is usually a CView-derived class).

Remarks

Returns the tab proxy window registered with Windows 7 taskbar tabs.

CMDITabProxyWnd* GetTabProxyWnd();

Return Value

A pointer to a CMDITabProxyWnd object, which is registered with Windows 7 taskbar tabs.

Remarks

Enables or disables automatic selection of a portion of a window's client area to display as that window's thumbnail in the taskbar.

void EnableTaskbarThumbnailClipRect(BOOL bEnable = TRUE);

Parameters

bEnable
Specifies whether to enable ( TRUE), or disable ( FALSE) automatic selection of a portion of a window's client area to display.

Remarks

Tells the framework whether this MDI child can be displayed on Windows 7 taskbar tabs.

virtual BOOL CanShowOnTaskBarTabs();

Return Value

TRUE if the content of the MDI child can be displayed on Windows 7 taskbar thumbnails.

Remarks

Override this method in a derived class and return FALSE to disable the appearance of this MDI child on Windows 7 taskbar tabs.

Called by the framework to activate the top level frame when the application is activated from a taskbar tab.

virtual void ActivateTopLevelFrame();

Remarks

Hierarchy Chart
Classes
CMDIChildWnd Class
CMFCWindowsManagerDialog Class
CMDIFrameWndEx Class

Show: