本文整理汇总了C++中CDuiRect::ResetOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ CDuiRect::ResetOffset方法的具体用法?C++ CDuiRect::ResetOffset怎么用?C++ CDuiRect::ResetOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDuiRect
的用法示例。
在下文中一共展示了CDuiRect::ResetOffset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInPlaceActivateEx
STDMETHODIMP CActiveXCtrl::OnInPlaceActivateEx(BOOL* pfNoRedraw, DWORD dwFlags)
{
DUITRACE(_T("AX: CActiveXCtrl::OnInPlaceActivateEx"));
ASSERT(m_pInPlaceObject==NULL);
if( m_pOwner == NULL ) return E_UNEXPECTED;
if( m_pOwner->m_pUnk == NULL ) return E_UNEXPECTED;
::OleLockRunning(m_pOwner->m_pUnk, TRUE, FALSE);
HWND hWndFrame = m_pOwner->GetManager()->GetPaintWindow();
HRESULT Hr = E_FAIL;
if( (dwFlags & ACTIVATE_WINDOWLESS) != 0 ) {
m_bWindowless = true;
Hr = m_pOwner->m_pUnk->QueryInterface(IID_IOleInPlaceObjectWindowless, (LPVOID*) &m_pInPlaceObject);
m_pOwner->m_hwndHost = hWndFrame;
m_pOwner->GetManager()->AddMessageFilter(m_pOwner);
}
if( FAILED(Hr) ) {
m_bWindowless = false;
Hr = CreateActiveXWnd();
if( FAILED(Hr) ) return Hr;
Hr = m_pOwner->m_pUnk->QueryInterface(IID_IOleInPlaceObject, (LPVOID*) &m_pInPlaceObject);
}
if( m_pInPlaceObject != NULL ) {
CDuiRect rcItem = m_pOwner->m_rcItem;
if( !m_bWindowless ) rcItem.ResetOffset();
m_pInPlaceObject->SetObjectRects(&rcItem, &rcItem);
}
m_bInPlaceActive = SUCCEEDED(Hr);
return Hr;
}
示例2: SetPos
void CActiveXUI::SetPos(RECT rc, bool bNeedInvalidate)
{
CControlUI::SetPos(rc, bNeedInvalidate);
if( !m_bCreated ) DoCreateControl();
if( m_pUnk == NULL ) return;
if( m_pControl == NULL ) return;
SIZEL hmSize = { 0 };
SIZEL pxSize = { 0 };
pxSize.cx = m_rcItem.right - m_rcItem.left;
pxSize.cy = m_rcItem.bottom - m_rcItem.top;
PixelToHiMetric(&pxSize, &hmSize);
if( m_pUnk != NULL ) {
m_pUnk->SetExtent(DVASPECT_CONTENT, &hmSize);
}
if( m_pControl->m_pInPlaceObject != NULL ) {
CDuiRect rcItem = m_rcItem;
if( !m_pControl->m_bWindowless ) rcItem.ResetOffset();
m_pControl->m_pInPlaceObject->SetObjectRects(&rcItem, &rcItem);
}
if( !m_pControl->m_bWindowless ) {
ASSERT(m_pControl->m_pWindow);
::MoveWindow(*m_pControl->m_pWindow, m_rcItem.left, m_rcItem.top, m_rcItem.right - m_rcItem.left, m_rcItem.bottom - m_rcItem.top, TRUE);
}
}
示例3: GetDC
STDMETHODIMP CActiveXCtrl::GetDC(LPCRECT pRect, DWORD grfFlags, HDC* phDC)
{
DUITRACE(_T("AX: CActiveXCtrl::GetDC"));
if( phDC == NULL ) return E_POINTER;
if( m_pOwner == NULL ) return E_UNEXPECTED;
*phDC = ::GetDC(m_pOwner->m_hwndHost);
if( (grfFlags & OLEDC_PAINTBKGND) != 0 ) {
CDuiRect rcItem = m_pOwner->GetPos();
if( !m_bWindowless ) rcItem.ResetOffset();
::FillRect(*phDC, &rcItem, (HBRUSH) (COLOR_WINDOW + 1));
}
return S_OK;
}