Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is how I got it to work:</p> <h3>First</h3> <p>, as the others said, create an invisible toolbar next to your main toolbar (I'm using the usual names based on AppWizard's names):</p> <pre><code>MainFrm.h: class CMainFrame { //... CMFCToolBar m_wndToolBar; CMFCToolBar m_wndInvisibleToolBar; //... }; MainFrm.cpp: int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { //... // Normal, visible toolbar if(m_wndToolBar.Create(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC)) { VERIFY( m_wndToolBar.LoadToolBar( theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME) ); // Only the docking makes the toolbar visible m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); DockPane(&amp;m_wndToolBar); } // Invisible toolbar; simply calling Create(this) seems to be enough if(m_wndInvisibleToolBar.Create(this)) { // Just load, no docking and stuff VERIFY( m_wndInvisibleToolBar.LoadToolBar(IDR_OTHERTOOLBAR) ); } } </code></pre> <h3>Second: The images and toolbar resources</h3> <p><code>IDR_MAINFRAME</code> and <code>IDR_MAINFRAME_256</code> were generated by AppWizard. The former is the ugly 16 color version and the latter is the interesting high color version.<br> Despite its name, if I remember correctly, even the AppWizard-generated image has 24bit color depth. The cool thing: Just replace it with a 32bit image and that'll work, too. </p> <p>There is the invisible toolbar <code>IDR_OTHERTOOLBAR</code>: I created a toolbar with the resource editor. Just some dummy icons and the command IDs. VS then generated a bitmap which I replaced with my high color version. Done!</p> <h3>Note</h3> <p>Don't open the toolbars with the resource editor: It may have to convert it to 4bit before it can do anything with it. And even <em>if</em> you let it do that (because, behind Visual Studio's back, wou're going to replace the result with the high color image again, ha!), I found that it (sometimes?) simply cannot edit the toolbar. Very strange.<br> In that case I advise to directly edit the .rc file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload