本文整理汇总了C++中CBCGPRibbonBar::GetSafeHwnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRibbonBar::GetSafeHwnd方法的具体用法?C++ CBCGPRibbonBar::GetSafeHwnd怎么用?C++ CBCGPRibbonBar::GetSafeHwnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRibbonBar
的用法示例。
在下文中一共展示了CBCGPRibbonBar::GetSafeHwnd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnShow
//.........这里部分代码省略.........
cx = max (cx, sizeDescr.cx);
cy = max (cy, m_sizeImage.cy);
}
if (m_sizeImage.cx > 0 && m_Params.m_bDrawIcon)
{
cx += m_sizeImage.cx + m_ptMargin.x;
}
cx += 2 * m_ptMargin.x;
cy += 2 * m_ptMargin.y;
int nFixedWidth = GetFixedWidth ();
if (nFixedWidth > 0 && sizeDescr != CSize (0, 0))
{
cx = max (cx, nFixedWidth);
}
CRect rectWindow;
GetWindowRect (rectWindow);
int x = rectWindow.left;
int y = rectWindow.top;
if (m_ptLocation != CPoint (-1, -1))
{
x = m_ptLocation.x;
y = m_ptLocation.y;
*pResult = 1;
}
CRect rectScreen;
MONITORINFO mi;
mi.cbSize = sizeof (MONITORINFO);
if (GetMonitorInfo (MonitorFromPoint (rectWindow.TopLeft (), MONITOR_DEFAULTTONEAREST),
&mi))
{
rectScreen = mi.rcWork;
}
else
{
::SystemParametersInfo (SPI_GETWORKAREA, 0, &rectScreen, 0);
}
int nBottom = max (
ptCursor.y + cy + ::GetSystemMetrics (SM_CYCURSOR),
y + cy + 2);
if (nBottom > rectScreen.bottom)
{
y = ptCursor.y - cy - 1;
#ifndef BCGP_EXCLUDE_RIBBON
if (m_pRibbonButton != NULL && m_ptLocation != CPoint (-1, -1))
{
ASSERT_VALID (m_pRibbonButton);
CBCGPRibbonBar* pRibbon = m_pRibbonButton->GetTopLevelRibbonBar ();
if (pRibbon->GetSafeHwnd () != NULL)
{
CRect rectRibbon;
pRibbon->GetWindowRect (rectRibbon);
y = rectRibbon.top - cy;
}
}
#endif
*pResult = 1;
}
if (x + cx + 2 > rectScreen.right)
{
if ((*pResult) == 1) // Y has been changed
{
x = ptCursor.x - cx - 1;
}
else
{
x = rectScreen.right - cx - 1;
*pResult = 1;
}
}
if ((*pResult) == 1)
{
SetWindowPos (NULL, x, y, cx, cy, SWP_NOZORDER | SWP_NOACTIVATE);
}
else
{
SetWindowPos (NULL, -1, -1, cx, cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
}
m_sizeCornerRadius = CBCGPVisualManager::GetInstance()->GetSystemToolTipCornerRadius(this);
SetWindowPos (&wndTop, -1, -1, -1, -1, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSIZE | SWP_DRAWFRAME);
}