派生クラスがCMFCToolBar
あり、そのインスタンスは派生クラスのメンバーですCDockablePane
。
VisualStudioDemo サンプルを見て、それがどのように行われているかを確認し、これまでのところ:
int CMyPane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// Removed all "return -1 on error" code for better readability
CDockablePane::OnCreate(lpCreateStruct);
if(m_toolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_MY_TOOLBAR) &&
m_toolBar.LoadToolBar(IDR_MY_TOOLBAR, 0, 0, TRUE /* Is locked */))
{
if(theApp.m_bHiColorIcons) // Is true, i.e. following code is executed
{
m_toolBar.CleanUpLockedImages();
m_toolBar.LoadBitmap(IDB_MY_TOOLBAR_24, 0, 0, TRUE /*Locked*/);
}
m_toolBar.SetPaneStyle(m_toolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
m_toolBar.SetPaneStyle(m_toolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));
m_toolBar.SetOwner(this);
// All commands will be routed via this control , not via the parent frame:
m_toolBar.SetRouteCommandsViaFrame(FALSE);
}
return 0;
}
ハイカラー イメージ (24 ビット) が読み込まれますが、マゼンタ マスク (R255 G0 B255) が表示されます。ツールバーにマスクを認識させる方法がわかりません。
これは可能ですか?