Click here to Skip to main content
15,613,873 members
Articles / Desktop Programming / WTL
Posted 22 Dec 2001


40 bookmarked

A Simple Tabbed MDI for WTL

Rate me:
Please Sign up or sign in to vote.
5.00/5 (4 votes)
22 Dec 2001
This is a simple tabbed MDI for WTL
Add a simple tab control that shows the opened child windows in an MDI application

Sample Image - wtlmditab.gif


This class adds a simple tab control in a WTL based MDI application. It is partly based on the freeware MFC version from Dundas Software available at:


First, include the header file and create a CMDITabImpl member in the main frame class.

#include "atlmditab.h"

class CMainFrame : public ....
    CMDITabImpl<CMainFrame> m_TabbedMDI;

Then attach to the control in main frame's OnCreate(..) function:

LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, 
    LPARAM /*lParam*/, BOOL& /*bHandled*/)

Then you must add an UpdateLayout() function in main frame to place the tab control correctly. If anybody finds a solution for WTL that won't require this extra code, please let me know.

void UpdateLayout(BOOL bResizeBars = TRUE)
    RECT rect;
    // position bars and offset their dimensions
    UpdateBarsPosition(rect, bResizeBars);
    m_TabbedMDI.UpdateTabLayout(m_hWndClient, rect);


This class is written for learning WTL, so there are surely lots of bugs in the implementation. And some features are not implemented yet, like icon support and context menu. I will work on them later when I get more time. Cheers!


  • 23rd December, 2001: Initial version


This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.

A list of licenses authors might use can be found here.

Written By
Web Developer
Sweden Sweden
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

Questionm_wndMDIClient Pin
XiaoK Lin15-Apr-12 4:10
XiaoK Lin15-Apr-12 4:10 
GeneralFails to build Pin
Anonymous29-Oct-02 4:09
Anonymous29-Oct-02 4:09 
GeneralRe: Fails to build Pin
Seunghyun Kim22-Sep-04 15:07
Seunghyun Kim22-Sep-04 15:07 
GeneralVery nice, but... Pin
Gavin Jerman11-Apr-02 4:37
Gavin Jerman11-Apr-02 4:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.