Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC hWnd pointers Pin
Steve Severance15-Jan-02 8:54
Steve Severance15-Jan-02 8:54 
GeneralRe: MFC hWnd pointers Pin
Jon Hulatt15-Jan-02 22:05
Jon Hulatt15-Jan-02 22:05 
GeneralRe: MFC hWnd pointers Pin
Nish Nishant15-Jan-02 22:30
sitebuilderNish Nishant15-Jan-02 22:30 
GeneralMessage handling/command routing Pin
Fredrik Skog14-Jan-02 3:08
Fredrik Skog14-Jan-02 3:08 
GeneralRe: Message handling/command routing Pin
Joaquín M López Muñoz14-Jan-02 3:18
Joaquín M López Muñoz14-Jan-02 3:18 
GeneralRe: Message handling/command routing Pin
Joaquín M López Muñoz14-Jan-02 3:28
Joaquín M López Muñoz14-Jan-02 3:28 
GeneralRe: Message handling/command routing Pin
Not Active14-Jan-02 4:15
mentorNot Active14-Jan-02 4:15 
GeneralRe: Message handling/command routing Pin
Fredrik Skog14-Jan-02 21:17
Fredrik Skog14-Jan-02 21:17 
The menu is already working fine. What I need to know is which button that invoked the menu. The button has a OnRButtonDown handler which displays the menu. When the user selects an item in the menu the command handling is taken care of in the parent toolbar. How do I make the toolbar aware of which button it was that issued the menu?

E.g.

CDynamicButton.cpp

void CDynamicButton::OnRButtonDown(UINT nFlags, CPoint point) 
{
	// Handle the menu (if any)
	if (m_hMenu)
	{
		HMENU	hSubMenu = NULL;
		CRect	rWnd;

		hSubMenu = ::GetSubMenu(m_hMenu, 0);
		GetWindowRect(rWnd);
		::TrackPopupMenuEx(hSubMenu, TPM_LEFTALIGN | TPM_LEFTBUTTON, rWnd.left, rWnd.bottom, m_hParentWndMenu, NULL);
	} // if

	CButton::OnRButtonDown(nFlags, point);
}

CMacroToolBarCtrl.cpp:

BEGIN_MESSAGE_MAP(CMacroToolBarCtrl, CDialogBar)
	ON_UPDATE_COMMAND_UI(ID_MENU_REMOVE, OnMenuRemove)
END_MESSAGE_MAP()

void CMacroToolBarCtrl::OnMenuRemove(CCmdUI* pCmdUI)
{
	// Need to remove the button here
}


Cheers,

/Fredrik

Sonork ID: 100.11430:PhatBoy

GeneralRe: Message handling/command routing Pin
Nish Nishant14-Jan-02 21:47
sitebuilderNish Nishant14-Jan-02 21:47 
GeneralRe: Message handling/command routing Pin
Fredrik Skog14-Jan-02 22:42
Fredrik Skog14-Jan-02 22:42 
GeneralRe: Message handling/command routing Pin
Fredrik Skog15-Jan-02 1:37
Fredrik Skog15-Jan-02 1:37 
GeneralEdit other window control Pin
Mark Daniel13-Jan-02 22:37
Mark Daniel13-Jan-02 22:37 
GeneralRe: Edit other window control Pin
Rickard Andersson2014-Jan-02 2:46
Rickard Andersson2014-Jan-02 2:46 
GeneralRe: Edit other window control Pin
Mark Daniel15-Jan-02 22:10
Mark Daniel15-Jan-02 22:10 
GeneralRe: Edit other window control Pin
Rickard Andersson2016-Jan-02 1:56
Rickard Andersson2016-Jan-02 1:56 
Generalkeeping track of modifications in an editor app Pin
13-Jan-02 20:34
suss13-Jan-02 20:34 
GeneralRe: keeping track of modifications in an editor app Pin
l a u r e n13-Jan-02 21:51
l a u r e n13-Jan-02 21:51 
QuestionHow to Changing a Cursor? Pin
nemati13-Jan-02 19:31
nemati13-Jan-02 19:31 
AnswerRe: How to Changing a Cursor? Pin
Rickard Andersson2013-Jan-02 21:13
Rickard Andersson2013-Jan-02 21:13 
GeneralDial-up entry's shortcut ... Pin
FayeGolf13-Jan-02 16:15
FayeGolf13-Jan-02 16:15 
GeneralRe: Dial-up entry's shortcut ... Pin
Joaquín M López Muñoz13-Jan-02 21:09
Joaquín M López Muñoz13-Jan-02 21:09 
GeneralCRichEditCtrl Pin
Dor13-Jan-02 15:59
Dor13-Jan-02 15:59 
GeneralAdding a custom button to Outlook Express using Windows Hook. Pin
Code Freeze13-Jan-02 12:26
Code Freeze13-Jan-02 12:26 
GeneralTo Port or Not To Port... That Is The Question Pin
William Bartholomew13-Jan-02 10:56
William Bartholomew13-Jan-02 10:56 
GeneralRe: To Port or Not To Port... That Is The Question Pin
Mike Nordell13-Jan-02 22:05
Mike Nordell13-Jan-02 22:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.