当前位置: 首页>>代码示例>>C++>>正文


C++ CDuiRect::ResetOffset方法代码示例

本文整理汇总了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;
	}
开发者ID:Crawping,项目名称:IocpServerClient_Side,代码行数:29,代码来源:UIActiveX.cpp

示例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);
		}
	}
开发者ID:Crawping,项目名称:IocpServerClient_Side,代码行数:28,代码来源:UIActiveX.cpp

示例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;
}
开发者ID:asdlei00,项目名称:duilib-1,代码行数:13,代码来源:UIActiveX.cpp


注:本文中的CDuiRect::ResetOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。