Drop down button notification
Posted on 2006-03-24
I am using a custom toolbar class in my MDI app. I am adding a dropdown button to it, which is working fine. My problem is that I am not receiving any notification as to when the drop down menu for the button is being created, though I have a handler for that event. Here are the pieces I am executing:
ON_NOTIFY(TBN_DROPDOWN, IDR_MYTOOLBAR, OnToolbarDropDown) // call me when user clicks button drop down!
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
m_MyToolbar.AddDropDownButton(this, BUTTON_ID_DRAW_A_HOUSE, MENU_ID_DRAW_A_HOUSE);
void CMainFrame::OnToolbarDropDown(NMHDR* pNMHDR, LRESULT* plRes)
// Shouldn't this be called when the user clicks the drop down arrow for my button?
AfxMessageBox("user hit drop down for toolbar button");
void CTrueColorToolBar::AddDropDownButton(CWnd* pParent, UINT uButtonID, UINT uMenuID)
// Custom toolbar class method for making a button 'drop down' - able.
GetToolBarCtrl().SendMessage(TB_SETEXTENDEDSTYLE, 0, (LPARAM)TBSTYLE_EX_DRAWDDARROWS);
DropDownInfo.pParent = pParent;
DropDownInfo.uButtonID = uButtonID;
DropDownInfo.uMenuID = uMenuID;
So my button has a dropdown with the menu I supplied, but my OnToolbarDropDown() handler is never getting called when my menu pops up. Any ideas why it is not getting called? I can supply more source code if necessary,