Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Suhai Gyorgy
|
Sep 23, 2005 - 1:52 AM
|
Hi! How can I add the "Show/Hide Statusbar" function to the context menu that pops up when I right-click the non-client area? I mean there’s any controlbar that is derived from CExtControlBar, but CExtStatusBar isn’t derived from that. I’m guessing you have to place some code in OnConstructPopupMenuCB function, but have no idea what kind of code to write. Could you help me in this? Thank you again.
|
|
Technical Support
|
Sep 23, 2005 - 6:09 AM
|
You need to handle the CExtControlBar::g_nMsgConstructPopupMenu registered message and, if you already have the Show/Hide Statusbar item in the main menu, just insert the corresponding menu item to the context menu like as follows: LRESULT CMainFrame::OnConstructPopupMenu( WPARAM wParam, LPARAM lParam )
{
ASSERT_VALID( this );
lParam;
CExtControlBar::POPUP_MENU_EVENT_DATA * p_pmed =
CExtControlBar::POPUP_MENU_EVENT_DATA::FromWParam( wParam );
ASSERT( p_pmed != NULL );
ASSERT_VALID( p_pmed->m_pPopupMenuWnd );
if( !p_pmed->m_bPostNotification )
{
VERIFY( p_pmed->m_pPopupMenuWnd->ItemInsert( ID_VIEW_STATUS_BAR ) );
}
return 0;
}
|
|