IE4 Style Menu (Rebar Menu) ' | CodeGuru

IE4 Style Menu (Rebar Menu) ‘

  Download Source Code and Example 72KB In Internet Explorer 4.0 Microsoft made some cool looking menu. When I use Spy ++ it shows that this is just toolbar inside rebar. I made some searches but I didn’t found anything like that on codeguru sites. So I made it myself. I used Luis Barreira Classes […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 22, 1998
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

 

Download Source Code and Example 72KB

In Internet Explorer 4.0 Microsoft made some cool looking menu. When I use Spy ++ it
shows that this is just toolbar inside rebar. I made some searches but I didn’t found
anything like that on codeguru sites.

So I made it myself.

I used Luis Barreira Classes for new IE4 controls
to get CRebar.

There are two main points of this solution:

First is creating buttons based on menu resource IDR_MAINFRAME, this fragment is from
CMainFrame OnCreate:

   //create toolbar buttons based on menu (IDR_MAINFRAME)
   TBBUTTON button;
   CString strItem;

   CMenu mTopMenu;
   mTopMenu.LoadMenu(IDR_MAINFRAME);

   UINT iPos;
   for (iPos = 0; iPos 

Then handler for buttons, this handler is called by macro
ON_COMMAND_RANGE, ClassWizard did not support this so you must take it from my example or
read some in MSDN.

// handler to menu buttons
void CMainFrame::OnMenu(UINT nID)
{
   CMenu m_mnuTopMenu;
   CRect rWindow,rButton;
   m_mnuTopMenu.LoadMenu(IDR_MAINFRAME);

   UINT iPos;
   for (iPos = 0; iPos TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_VERTICAL,rWindow.left,rWindow.top,this);
         m_wndMenuBar.GetToolBarCtrl().SetState(iPos+1,TBSTATE_ENABLED);
         break;
      }
   }

}

That's it.

In this moment this solution don't support accelerators to button.

Last updated: 16 July 1998

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.