Stack Window


Sample Image

Overview on stack window

The stack window gives alternative way to manage multiple dialog boxes inside single window (see picture). Unlike standard property sheet control layout of stack window is vertical. Pages are separated with captions. Page captions displays user-defined name and can be clicked to expand/contract the page. If size of stack window exceeds size of parent's client area user can pan window contents by clicking and dragging on the whitespace area or static/disabled control of child dialog box.

How to use stack window in your application

1. Add member variable in your CMainFrame class:

CStackWnd m_wndStack;

2. Create stack window during main frame creation

   int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
	if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	if (!m_wndStack.Create(NULL, NULL, WS_CHILD | WS_VISIBLE,
		CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
		TRACE0("Failed to create view window\n");
		return -1;


3. Create dialog box template and dialog box class. Dialog box should be invisible child.

4. Insert a page into stack window

CDialog* pDlg;
pDlg = new CMyDialog;
m_wndStack.InsertPage(pDialog, IDD_MY_DIALOG, _T("My dialog"),

5. Return to step 3 to add more pages.

Page flags

The combination of following values can be passed to dwFlags parameter of CStackWnd::InsertPage:

Page is visible

Page is contracted (i.e. only caption is visible)


You should ensure the size of parent window is less or equal to size of the child stack window.


Download demo project - 64 Kb
Download source - 9 Kb


  • reviews after use clarisonic mia 2

    Posted by iouwanzi on 06/06/2013 01:39pm

    [url=]clarisonic classic[/url] Excessive, que le logiciel est généralement toute expression caractérisant cette campagne innovante spécifique dénommée collection écarlate dans hommage vers les années folles. Juste pour votre affaire, la présence publique dans le type, Katy Perry est immortalisée tout simplement parce que le blanc lumineux au sol avec la fonction habilité par le numérique photographe David LaChapelle. Golf sautes très étonnante et encore plein d’identité parfaite pour la commercialisation des cas uniques ghd. [url=]clarisonic mia[/url] Utile pour déterminer la nature des cheveux ghd fer bruns de l’enfant, sculptée cheveux bouclés est très souple et le degré volume riche, le contexte plus sain et dynamique des muscles du blé. Les os émettent félin sexy Candice Swanepoel, même les femmes sont inconsciemment attiré par elle. Looks fines et douces boucles dorées, semble exceptionnellement douce et fraîche. Hairline n’est pas évident tailler plus délibérée, un peu paresseux et charmante nature elle-même. Sans aucune modification de toute la personne, de ne pas montrer délibérément, peut émettre goût mignonne et sexy. [url=]clarisonic mia[/url] et en plus vous savez quoi ? Cette approche n’est pas presque tous. Est normalement photographié, à peu près chaque période unique, juste par le photographe professionnel populaire particulière ? Certes, le logiciel n’est pas tout un plus petit montant connu Katy.concernant pour lequel vous consacrez une bonne période de 7 jours. Juste pour une partie, Document mis au point plusieurs évolutions dont je parle avant longtemps. Bien sûr, le logiciel peut-être promi ! Toujours juste avant tout cela, Document allait donner à ma propre volonté.

  • Elect in-ear earphones along with earphones cover your eyes

    Posted by motherdhmm on 06/04/2013 08:01pm

    [url=]beats by dre[/url] We call to mind a consider you will requisite valid headphone or earphone to hearken to music and pay attention to some information sounds.Enjoy fast-moving games and your darling music wherever you go.Provide various high eminence earphone, Headphone products to all customers.We improvise you want like these feelings that exploit our headphone or earphone to attend to music.We Late Style Beats make offer you concern and upper crust service. [url=]beats by dre nz[/url] Low-priced beats around dre Dreuncomfortable tenderness. Your stage hearing watch over to be redress it possible for drop in on anyhow since expeditiously for the sake those who require inseparable outstanding associates beast is haler than earphones. Moreover, it really is honesty a possessions to be able to churn to to exist the power to be off that Is better than doctor dre. beats past dre Is haler than hea.The decisive affectivity involving Deformity Beats on Generate. Dre Studio is drastically much ripping in relation with Brute Beats Individual Hi-def. Specifically, Beats Headphone assignation extremely reasonably really seemly with reduced balance, sleazy beats by dre furthermore while striper robustness and adaptability. [url=]monster beats Australia[/url] Fitting for Mutation headphones australia, the articulate is eternally the most important. When it is specific to each day we using beats at hand dre australia tuppence headphones. We belief that at the epoch of you are enjoying the music, you would not be apprehensive nigh the wind of the cable. Barbarity the beats nigh dr dre lackadaisical headphone adopted the late stretched out cabel which can prevent the mailgram from winding, with the sketch out of tough plugs, you could dig your favourite music without the boring the winding line effect to you.

  • Lightweight perceptive – Nike Loose TR Attack in spring 2013 3 series

    Posted by Tufffruntee on 04/19/2013 05:10am

    Nike Free TR Suited 3 prominent features is to use the additional forge: Nike Let off 5 soles improved bending Groove; new tractor pattern making training more focused when; lighter ballast, the permeability is stronger, and more in fashion shoe designs not just order shoes [url=]nike huarache free[/url] more smug wearing, barefoot training sensible of, but also more in vogue appearance. Nike Manumitted TR Fitting 3 provides supreme lateral stability, you can be suffering with the legs in the part during training. Strong vamp superiority breathable mesh, lower soap up's unique delineate can be [url=]nike free run uk[/url] seen by virtue of it. Lightweight, demanding, pinched bubbles facts habituated to at hand entirely some seams, more amenable, support is stronger. Lack more mainstay, role of a training irritate, lather come in more parts of the need after agreeableness, bubble loose. Use double patois moisture wicking fake materials, tiresome on your feet, help maintain feet tiring and comfortable. Phylite [url=]nike free[/url] midsole offers lightweight stupor level, famous durability and unbroken outsole can do to greatly reduce the comprehensive load of the shoe. Qianzhang pods on the outsole and heel-shaped Grassland rubber enhances the shoe multi-directional gripping power on odd surfaces.

  • Stack Window

    Posted by Legacy on 12/28/1999 12:00am

    Originally posted by: Masoud

    Hi every body,

    Cool thing!, But i've been trying to add it to a CFormView
    inside the LefPane of a splitted (2,1) child view app.

    It don't give what i want, instead it loads only the empty form without the stack window or the controls dialog pages on it, just plane sheet!

    I wonder any one can help?

    Thank you and Merry Xmas with wishes for a very happy 2000.


  • used sample to create a dialogbar

    Posted by Legacy on 10/11/1999 12:00am

    Originally posted by: wolfram

    wow, very good.
    I used the StackWnd class as a sample to create a cool dialogbar. I devired the StackWnd class from CControlBar instead of CWnd and added some changes for control bar behavier. If someone would like to get the code, send a mail and i will publish it here.

  • not really a bug, but it's better to be fixed ..

    Posted by Legacy on 09/09/1999 12:00am

    Originally posted by: alexander

    First of all, this is really cool stuff.

    As to the problem : you are missing DT_SINGLELINE flag in CDC::DrawText() call, thus making DT_VCENTER flag meaningless (refer to the mfc docs). See code below for the fix.

    Another comment is that I believe it would be more appropriate to define member variable of type CFont and initialize it once (say, in [PrecreateWindow]) and then just use it in [DrawPageCaption]. Plus you would be able more accurately compute the value of [m_cyCaption] as it depends on the font chars.

    void CStackWnd::DrawPageCaption(...)

    if (lpszText)

    pDC->DrawText(lpszText, lpRect,


  • Memory leaks :(

    Posted by Legacy on 09/01/1999 12:00am

    Originally posted by: Jack

    Nice job, but on closing of stack window
    dialogs stays in the memory.

    The solution is:

    void CStackWnd::ClearPageInfo()
    CPageInfo* ptr = m_pPageInfo, *ptrNext;
    while (ptr)
    ptrNext = ptr->m_pNext;

    // !! This line solve the problem:
    delete ptr->m_pDlg;

    delete ptr;
    ptr = ptrNext;

    m_pPageInfo = NULL;

  • Suggestion: indicators

    Posted by Legacy on 08/19/1999 12:00am

    Originally posted by: Tomaz Stih

    It`s a cool class. How about a little improvement? Since there is no scroll bar user has no way of knowing that there is more info above the window limit. Maybe adding cool looking up and down indicators would be an improvement.


  • Font Problems under Win98 1st Edition

    Posted by Legacy on 08/15/1999 12:00am

    Originally posted by: Wraith Zero

    All in all, a nice little feature!  Thanks for the contribution!

    However, in testing I encountered some problems with fonts on the page captions ...

    In the DrawPageCaption() method, simply replace the existing

    if (lpszText)

    clause with the one below:

    // draw text
    if (lpszText)
    CFont font;
    LOGFONT lf;
    WU_GetDefaultGUIFont(8, &lf);

    //$ WRAITH: Preserve previous font
    CFont *pfontOld = (CFont*)pDC->SelectObject(&font);

    pDC->DrawText(lpszText, lpRect, DT_CENTER | DT_VCENTER);

    //$ WRAITH: Restore original font

    Also, I've found some painting anomalies which occur when dragging the client area around and resizing the dialog to its full normal size ... though I haven't had the time to look into it yet.

    Thanks for the great work and keep 'em coming!

    - Wraith Z

  • Круто

    Posted by Legacy on 08/05/1999 12:00am

    Originally posted by: Alex II

    Просто круто

  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date