A Control like IE 4's Favorites/History/Channels View

Everyone knows the new menu-like left pane view's in IE4. But did you know that this is only a extended TreeView? You can do this by using CUSTONDRAW notification in the new from CTreeCtrl derived class. I called it CTreeMenu. To do this is quite easy. See an code extract below.
But note: This works only with the extended TreeCtrl that comes with IE4. You can use my wrapper class or the one from Luis Barreira IE4 Classes. This should also work, but I didn't test it. Also on Codeguru's Webpage.

I wrote a class, that makes the handling pretty easy. Included are a Button to close the view and some Bevel stuff to be uptodate with the Windows style. There is also a self RegisterClass() function to use as a CustomControl on Dialog Templates.

The Frame use the SizingControlBar from Cristi Posea also found here on Codeguru's Webpage.

See more details in code comments.

void CTreeMenu::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult) 

	CDC* pDC = CDC::FromHandle(pTVCD->nmcd.hdc);

	// The rect for the cell gives correct left and right values
	CRect rect = pTVCD->nmcd.rc;
	// By default set the return value to do the default behavior
	*pResult = 0;

	switch( pTVCD->nmcd.dwDrawStage )
		// First stage (for the whole control

		// Stage three (called for each subitem of the focused item

		// Stage four (called for each subitem of the focused item
				*pResult = CDRF_SKIPDEFAULT;	
			// Stage two handled here. (called for each item
			if (pTVCD->nmcd.uItemState & CDIS_HOT)
				pDC->Draw3dRect( &rect, m_clr3DHilight, m_clr3DShadow );
				// Tell the control that to draw it again


			if (pTVCD->nmcd.uItemState & CDIS_SELECTED)
				*pResult = CDRF_SKIPDEFAULT;

			if( (pTVCD->nmcd.uItemState & CDIS_FOCUS) )
				pDC->Draw3dRect( &rect, m_clr3DShadow, m_clr3DHilight );
			if( (pTVCD->nmcd.uItemState & CDIS_CHECKED) )
				*pResult = CDRF_DODEFAULT;

Download demo - 70KB

P.S: Did everyone has successfull experienced with the new pager control (see latest "commctrl.h"), please send a notice to Rainer Pfitzner

Date Posted: 05/13/98


  • The most important bvlgari purse Business venture Speak - - Visitors who cares about stress triumphs?!?

    Posted by expopmerm on 03/22/2013 08:30pm

    Brand new questions regarding bvlgari purse replied and consequently the reasons you have got to study every message in this guide. [url=http://www.bvlgarishopjprie.com]ブルガリ[/url] The greatest key for bvlgari purse that you will understand more about straight away. [url=http://www.bvlgarioutletshopjp.com]ブルガリ 時計[/url] Heya- All together we could help make bvlgari purse a lot better ! [url=http://www.bvlgarisalekodojp.com]ブルガリ店舗[/url] Everything that the competition actually does concerning bvlgari purse and moreover specifically what you want to do different. [url=http://www.bvlgarisakaijpsale.com]ブルガリブルガリ[/url] bvlgari purse Knockoffs -- The Most Beneficial bvlgari purse hack Regarding Fools 98% of the end-users [url=http://www.bvlgariaokisalejp.com]ブルガリブルガリ[/url] Your own double turn on bvlgari purse mcm Teaches You Different Verbiage . . . Our Company Step Into The Proceeding [url=http://www.mcmbagsjphadori.com]MCM 店舗[/url] The Things Everyone Seems To Be Reporting About mcm Is In Fact Dead Wrong And Reason Why [url=http://www.mcmstorejpkodo.com]mcm[/url] mcm Fakes . . . Wonderful mcm Hack Regarding Fools 87.5% Of The Buyers [url=http://www.mcmoutletjpinoue.com]mcm 店舗[/url] mcm Brings All New Life To The Old Matter-- Defacto Popular [url=http://www.mcmsalejapanoka.com]MCM 財布[/url] The Best Way To Earn Money From Home Using mcm [url=http://www.mcmzankijpshop.com]mcm バッグ[/url] Ways To Steer Clear Of mcm Troubles

  • Just stop Protesting And Commence your personal nike shoes Marketing plan Instead

    Posted by expopmerm on 03/18/2013 01:54am

    Rare post gives the main points around adidas shoes which experts state a few personsare conscious of.|Brief guide demonstrates to you all the cogs and wheels on nike shoes and also those things that you ought to do this afternoon.}[url=http://www.nikejapan.asia/]ナイキ air [/url] Specifically how to master all that there is to find around nike shoes in five basic steps. [url=http://www.adidasjapan.biz/]adidas シューズ[/url] Info- adidas shoes Will certainly Have An Important role In Virtually Any Site administration Update: gucci Can Have Major role In Virtually Any Website administration [url=http://www.guccijp.asia/]gucci 財布[/url] New chloe Book Will show Guidelines On How To Rule The chloe Marketplace [url=http://www.chloejp.biz/]クロエ 財布[/url] 8 carefully-protected chanel tricks explained in clear detail. [url=http://www.chaneljp.biz/]シャネル バッグ[/url] Tips to find out all sorts of things there is to understand regarding chanel in 3 rather simple steps.A Slack Guy's Process To The nike shoes Triumph [url=http://www.adidasjapan.asia/]アディダス シューズ[/url] The things that all the others does in regard to adidas shoes and moreover something that you are looking to do different. [url=http://www.nikejp.biz/]nike running[/url] Strategies about how to learn pretty much everything there is to find concerning nike shoes in 5 basic steps.

  • How to change 16-color Icons into truecolor

    Posted by Legacy on 04/27/2003 12:00am

    Originally posted by: Jack

    How to change 16-color Icons into truecolor?
    use SetImageList only allow to use 16-color bitmap.

  • How to place two sidepanes in the same column?

    Posted by Legacy on 09/18/2002 12:00am

    Originally posted by: Min Tang

    It is very good and the the very thing I was looking for, but I still have problem on it needing help.
    That is, I want to place the second sidepane to the bottom of the first one, but I found I can't. The second sidepane is always on the left side of the first one. How to solve this problem? Thank you very much!

  • Changes for debug version

    Posted by Legacy on 09/04/2002 12:00am

    Originally posted by: eflame

    // sizecbar.h
    class CSizingControlBar : public CControlBar
    virtual BOOL Create(CWnd* pParentWnd,sizeDefault, UINT nID, DWORD dwStyle = CBRS_TOP);

    // sizecbar.cpp
    BOOL CSizingControlBar::Create(CWnd* pParentWnd, CSize sizeDefault, UINT nID, DWORD dwStyle)

  • Error

    Posted by Legacy on 08/28/2002 12:00am

    Originally posted by: hongky

    !!!!Memery Error!!!!

  • 干得不错,伙计~~~

    Posted by Legacy on 03/10/2002 12:00am

    Originally posted by: 麟麟


  • Windows2000 is not play..

    Posted by Legacy on 10/12/2001 12:00am

    Originally posted by: Chung daewon

    how >??

  • Release Build Error

    Posted by Legacy on 03/29/2001 12:00am

    Originally posted by: Bryan

    This code does not work in Release mode. After building the .exe in Release, if you click on the DragCaption ("Tree Menu"), the program bombs with this error:

    "The instruction at "..." referenced memory at "...". The memory could not be "read"."

    I suggest reverting back to Cristi Posea's original code (found here at CodeGuru) and modifying it yourself to suit your app.

  • Help Me

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

    Originally posted by: Rajabhakshi

    I compiled this demo successfully in VC6.0 by commenting SetBorder() and GetBorder() functions. While executing it gave me assertion failure.

    Help me as soon as possible

  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • Featuring Kate Leggett, VP and Principal Analyst, Forrester Research Live Event Date: October 19, 2016 @ 10 AM PT / 1 PM ET Omnichannel self-service is the new paradigm. Firms are organizing to provide self-service options across all channels in order to meet customer needs and expectations—going beyond traditional IVR. Are you prepared to offer your customers personalized self-service across all channels including legacy applications like your IVR?

  • Microsoft® Office 365 is a top choice for enterprises that want a cloud-based suite of productivity/ collaboration applications. With Office 365, you get access to Microsoft™ Office solutions practically anytime, anywhere, on virtually any device. It's a great option for current Microsoft users who can now build on their experience with Microsoft™ solutions while enjoying the flexibility of a cloud-based delivery. But even organizations with no previous investment in Microsoft will find that …

Most Popular Programming Stories

More for Developers

RSS Feeds

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