本文整理汇总了C++中CExtControlBar::GetSafeHwnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CExtControlBar::GetSafeHwnd方法的具体用法?C++ CExtControlBar::GetSafeHwnd怎么用?C++ CExtControlBar::GetSafeHwnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CExtControlBar
的用法示例。
在下文中一共展示了CExtControlBar::GetSafeHwnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _ContextMenuBuild
void CExtDockBar::_ContextMenuBuild(
CFrameWnd * pFrame,
CExtPopupMenuWnd * pPopup
)
{
ASSERT_VALID( pFrame );
ASSERT( pPopup != NULL );
ExtControlBarVector_t vBars;
CExtControlBar::_GetFrameControlBars(
pFrame,
vBars
);
bool bOleInplaceItemActivated =
CExtControlBar::IsOleIpObjActive( pFrame );
int nBarsCount = vBars.GetSize();
CExtControlBar * pPrevBar = NULL;
for( int i=0; i<nBarsCount; i++ )
{
CExtControlBar * pBar = vBars[i];
ASSERT_VALID( pBar );
if( pBar->GetSafeHwnd() == NULL )
continue;
// do not include temporary hidden bars
if( pBar->m_nStateFlags &
(CControlBar::delayHide | CControlBar::tempHide)
)
continue;
// do not include some bars when OLE inplace object active
if( bOleInplaceItemActivated &&
(pBar->m_dwStyle & CBRS_HIDE_INPLACE)
)
continue;
// do not include bars without caption
CString sBarText;
pBar->GetWindowText( sBarText );
if( sBarText.IsEmpty() )
{
ASSERT( FALSE );
continue;
}
if( pPrevBar != NULL
&&
pPrevBar->m_bFixedMode != pBar->m_bFixedMode
)
{
VERIFY(
pPopup->ItemInsert(
CExtPopupMenuWnd::TYPE_SEPARATOR
)
);
}
pPrevBar = pBar;
int nBarID = pBar->GetDlgCtrlID();
ASSERT( CExtCmdManager::IsCommand(nBarID) );
CExtCmdManager::cmd_t cmd;
cmd.m_nCmdID = nBarID;
cmd.m_sMenuText = sBarText;
cmd.TipsLoad();
g_CmdManager->CmdSetup(
g_CmdManager->ProfileNameFromWnd( pFrame->GetSafeHwnd() ),
cmd
);
VERIFY(
pPopup->ItemInsert(
nBarID
)
);
} // for( int i=0; i<nBarsCount; i++ )
}